From dfee38f4370c8556ec408f081b92b3b9b56f98d6 Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Tue, 2 Jul 2024 19:54:05 +0200 Subject: [PATCH] sort home manager settings --- common.nix | 12 +----------- users.nix | 25 +++++++++++++++++++++---- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/common.nix b/common.nix index a0a7a8e..88582f5 100644 --- a/common.nix +++ b/common.nix @@ -1,21 +1,17 @@ { config, pkgs, ... }: let impermanence = builtins.fetchTarball "https://github.com/nix-community/impermanence/archive/master.tar.gz"; - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; in { # # stuff shared between home machines # - # get impermanence & home manager working + # get impermanence working & include more shared parts imports = [ # manage persistent files "${impermanence}/nixos.nix" - # home manager for per user config - "${home-manager}/nixos" - # our users "/data/nixos/users.nix" ]; @@ -278,12 +274,6 @@ in systemd.targets.hibernate.enable = false; systemd.targets.hybrid-sleep.enable = false; - # let home manager install stuff to /etc/profiles - home-manager.useUserPackages = true; - - # use global pkgs - home-manager.useGlobalPkgs = true; - # allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/users.nix b/users.nix index 44c5283..2cb3352 100644 --- a/users.nix +++ b/users.nix @@ -1,6 +1,14 @@ { config, pkgs, ... }: - +let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; +in { + # get home manager working + imports = [ + # home manager for per user config + "${home-manager}/nixos" + ]; + users = { # all users and passwords are defined here mutableUsers = false; @@ -45,7 +53,16 @@ }; }; - # use shared home manager settings for all users - home-manager.users.root = import ./home.nix; - home-manager.users.cullmann = import ./home.nix; + # home manager settings + home-manager = { + # let home manager install stuff to /etc/profiles + useUserPackages = true; + + # use global pkgs + useGlobalPkgs = true; + + # use shared home manager settings for all users + users.root = import ./home.nix; + users.cullmann = import ./home.nix; + }; }