diff --git a/features/desktopish/autolock.nix b/features/desktopish/autolock.nix index e78808b..ea0eac5 100644 --- a/features/desktopish/autolock.nix +++ b/features/desktopish/autolock.nix @@ -13,4 +13,21 @@ killtime = 10; # mins killer = "${pkgs.systemd}/bin/systemctl suspend"; }; + + environment.systemPackages = [ + # A script to disable auto-suspend until unlocking the computer the next + # time. The idea is to leave this running on desktop, whilst taking my + # laptop to another room and ssh to the desktop. + (pkgs.writeScriptBin "estivate" + '' + #!${pkgs.runtimeShell} + set -xe + date + ${pkgs.xautolock}/bin/xautolock -disable + ${pkgs.xlockmore}/bin/xlock + date + ${pkgs.xautolock}/bin/xautolock -enable + ${pkgs.cowsay}/bin/cowsay "Welcome back!" + '') + ]; } diff --git a/flake.lock b/flake.lock index 46505eb..343bda0 100644 --- a/flake.lock +++ b/flake.lock @@ -167,17 +167,17 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1618260938, - "narHash": "sha256-sRIKbJKplnAY9uN4QGGVtq4dasRKzmZhjleCUtPvTa8=", + "lastModified": 1618251784, + "narHash": "sha256-/IG7op2hUVnjzKt2UXL152+YsL0gdPakk6/RxondIJ0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e8893cc489de8ffbe8125fb0d37f05e8023a2d99", + "rev": "311ceed827f531f88f46222920cd1ebb2c101f73", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "e8893cc489de8ffbe8125fb0d37f05e8023a2d99", + "rev": "311ceed827f531f88f46222920cd1ebb2c101f73", "type": "github" } }, diff --git a/flake.nix b/flake.nix index f94199b..09869fb 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ # https://status.nixos.org/ # # This ensures that we always use the official # cache. - nixpkgs.url = "github:nixos/nixpkgs/e8893cc489de8ffbe8125fb0d37f05e8023a2d99"; + nixpkgs.url = "github:nixos/nixpkgs/311ceed827f531f88f46222920cd1ebb2c101f73"; nixos-hardware.url = github:NixOS/nixos-hardware/master; home-manager.url = "github:nix-community/home-manager";