From f70599d5ca3076ee49955610e5e5a497eec35120 Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+julm-nix@sourcephile.fr>
Date: Fri, 22 Oct 2021 06:11:01 +0200
Subject: [PATCH] home-manager: update

---
 flake.nix                  | 12 +++++++++---
 homes/sevy.nix             |  4 ++--
 homes/softwares/gnupg.nix  |  6 +++---
 homes/softwares/podl.nix   |  5 -----
 homes/softwares/vim.nix    |  7 ++++---
 homes/softwares/xmonad.nix |  4 ++--
 hosts/oignon.nix           |  1 -
 hosts/patate.nix           |  3 ---
 8 files changed, 20 insertions(+), 22 deletions(-)
 delete mode 100644 homes/softwares/podl.nix

diff --git a/flake.nix b/flake.nix
index e38b065..e4f4fc6 100644
--- a/flake.nix
+++ b/flake.nix
@@ -27,17 +27,23 @@ outputs = inputs: let
     '';
   };
   lib = originPkgs.lib;
+  nixosSystem = import (nixpkgsPath + "/nixos/lib/eval-config.nix");
+  #nixosSystem = inputs.nixpkgs.lib.nixosSystem;
   in {
   nixosConfigurations = lib.genAttrs
     (builtins.attrNames (lib.filterAttrs (n: v: v == "directory") (builtins.readDir ./hosts)))
-    (hostName: import (nixpkgsPath + "/nixos/lib/eval-config.nix") {
-              #inputs.nixpkgs.lib.nixosSystem {
+    (hostName: nixosSystem rec {
       system = "x86_64-linux";
       extraArgs = {
         inherit hostName inputs;
         hosts = inputs.self.nixosConfigurations;
         private = "/root/private"; # Kept out of /nix/store
       };
+      pkgs = import nixpkgsPath {
+        inherit system;
+        config.allowUnfree = true; # For hplip
+        overlays = import nixpkgs/overlays.nix;
+      };
       modules = [
         (import (./hosts + "/${hostName}.nix"))
         inputs.nixpkgs.nixosModules.notDetected
@@ -46,7 +52,7 @@ outputs = inputs: let
           nix.registry.nixpkgs.flake = inputs.nixpkgs;
           nix.package = pkgs.nixFlakes;
           nix.extraOptions = "experimental-features = nix-command flakes";
-          nixpkgs.overlays = import nixpkgs/overlays.nix;
+          #nixpkgs.overlays = import nixpkgs/overlays.nix;
           /*
           system.nixos.versionSuffix = ".${
             lib.substring 0 8 (inputs.self.lastModifiedDate or inputs.self.lastModified)}.${
diff --git a/homes/sevy.nix b/homes/sevy.nix
index 1696f9e..111404f 100644
--- a/homes/sevy.nix
+++ b/homes/sevy.nix
@@ -41,9 +41,9 @@ services.screen-locker = {
     ${pkgs.xsecurelock}/bin/xsecurelock
   '');
     #XSECURELOCK_SWITCH_USER_COMMAND="${pkgs.lightdm}/bin/dm-tool switch-to-greeter" \
-  enableDetectSleep = true;
   inactiveInterval = lib.mkDefault 5; # minutes
-  xssLockExtraOptions = [
+  xautolock.detectSleep = true;
+  xss-lock.extraOptions = [
     "--transfer-sleep-lock"
     #"-n" "${pkgs.xss-lock}/share/doc/xss-lock/dim-screen.sh"
   ];
diff --git a/homes/softwares/gnupg.nix b/homes/softwares/gnupg.nix
index 677ac64..956820c 100644
--- a/homes/softwares/gnupg.nix
+++ b/homes/softwares/gnupg.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, config, options, ... }:
+{ pkgs, lib, config, ... }:
 {
 config = {
 /*
@@ -43,7 +43,7 @@ home.file."${config.programs.gpg.homedir}/dirmngr.conf".text = ''
   #log-file dirmngr.log
   #standard-resolver
 '';
-} // lib.optionalAttrs (options ? "nixpkgs") {
+}/* // lib.optionalAttrs (!config.useGlobalPkgs) {
 nixpkgs.overlays = [ (self: super: {
   # Avoid rebuilding graphical dependencies
   # when using Nixpkgs PRs rebuilding them.
@@ -52,5 +52,5 @@ nixpkgs.overlays = [ (self: super: {
     enabledFlavors = [ "curses" "tty" ] ++ lib.optional config.host.desktop "gtk2";
   };
 }) ];
-};
+}*/;
 }
diff --git a/homes/softwares/podl.nix b/homes/softwares/podl.nix
deleted file mode 100644
index ffa3e46..0000000
--- a/homes/softwares/podl.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-config = lib.optionalAttrs (options ? "nixpkgs") {
-  nixpkgs.overlays = [()];
-};
-}
diff --git a/homes/softwares/vim.nix b/homes/softwares/vim.nix
index 3f147bf..485801b 100644
--- a/homes/softwares/vim.nix
+++ b/homes/softwares/vim.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, config, options, ... }:
+{ pkgs, lib, config, ... }:
 let inherit (builtins) readFile; in
 {
 config = {
@@ -71,7 +71,8 @@ programs.neovim = {
     #pkgs.vimPlugins.fugitive
   ];
 };
-} // lib.optionalAttrs (options ? "nixpkgs") {
+} /* // lib.optionalAttrs (!config.useGlobalPkgs) {
   nixpkgs.config.vim.gui = if config.host.desktop then "gtk3" else "";
-};
+}*/;
+
 }
diff --git a/homes/softwares/xmonad.nix b/homes/softwares/xmonad.nix
index 06689b9..6b77f29 100644
--- a/homes/softwares/xmonad.nix
+++ b/homes/softwares/xmonad.nix
@@ -36,9 +36,9 @@ services.screen-locker = {
     ${pkgs.xsecurelock}/bin/xsecurelock
   '');
     #XSECURELOCK_SWITCH_USER_COMMAND="${pkgs.lightdm}/bin/dm-tool switch-to-greeter" \
-  enableDetectSleep = true;
   inactiveInterval = lib.mkDefault 3; # minutes
-  xssLockExtraOptions = [
+  xautolock.detectSleep = true;
+  xss-lock.extraOptions = [
     "--transfer-sleep-lock"
     #"-n" "${pkgs.xss-lock}/share/doc/xss-lock/dim-screen.sh"
   ];
diff --git a/hosts/oignon.nix b/hosts/oignon.nix
index 9869c58..8072d86 100644
--- a/hosts/oignon.nix
+++ b/hosts/oignon.nix
@@ -86,7 +86,6 @@ services.openssh.openFirewall = false;
 services.openssh.forwardX11 = true;
 services.openssh.passwordAuthentication = false;
 
-nixpkgs.config.allowUnfree = true;
 environment.etc."nixpkgs".source = pkgs.path;
 environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
 
diff --git a/hosts/patate.nix b/hosts/patate.nix
index b0f04db..4d626f4 100644
--- a/hosts/patate.nix
+++ b/hosts/patate.nix
@@ -63,9 +63,6 @@ nix = {
 };
 services.openssh.passwordAuthentication = false;
 
-nixpkgs.config = {
-  allowUnfree = true;
-};
 environment.etc."nixpkgs".source = pkgs.path;
 environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
 environment.systemPackages = [
-- 
2.47.2