From 4852bfe01b8a7453c902b2d78d627fa70d622dfb Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 22 Jun 2023 12:48:11 +0100 Subject: [PATCH] Move common into flake.nix (working this time) --- common.nix | 34 ---------------------------------- flake.nix | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 36 deletions(-) delete mode 100644 common.nix diff --git a/common.nix b/common.nix deleted file mode 100644 index 7db22e8d..00000000 --- a/common.nix +++ /dev/null @@ -1,34 +0,0 @@ -{lib, ...}: let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in { - imports = [(import "${home-manager}/nixos")]; - nix = { - settings.experimental-features = ["nix-command" "flakes"]; - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - extraOptions = '' - keep-outputs = true - keep-derivations = true - ''; - }; - system.autoUpgrade.enable = lib.mkDefault false; - nixpkgs.config.allowUnfree = true; - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - }; - networking.networkmanager.enable = true; - services.power-profiles-daemon.enable = true; - virtualisation.podman.enable = true; - programs = { - ssh.startAgent = true; - dconf.enable = true; - fish.enable = true; - zsh.enable = true; - }; - fonts.fontconfig.enable = true; - environment.localBinInPath = true; -} diff --git a/flake.nix b/flake.nix index 34d6d993..99cc03f0 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,37 @@ nixpkgs, home-manager, }: let + common = {lib, ...}: { + nix = { + settings.experimental-features = ["nix-command" "flakes"]; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + }; + extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + }; + system.autoUpgrade.enable = lib.mkDefault false; + nixpkgs.config.allowUnfree = true; + home-manager = { + useGlobalPkgs = true; + useUserPackages = false; + }; + networking.networkmanager.enable = true; + services.power-profiles-daemon.enable = true; + virtualisation.podman.enable = true; + programs = { + ssh.startAgent = true; + dconf.enable = true; + fish.enable = true; + zsh.enable = true; + }; + fonts.fontconfig.enable = true; + environment.localBinInPath = true; + }; hardware-audio = {pkgs, ...}: { # Enable sound with pipewire. sound.enable = true; @@ -39,8 +70,8 @@ system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager + common ./hosts/Legion/configuration.nix - ./common.nix ./services/Legion.nix ]; }; @@ -48,10 +79,10 @@ system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager + common hardware-audio hardware-bluetooth ./hosts/N0245/configuration.nix - ./common.nix ./wm/sway.nix ./services/syncthing/N0245.nix ];