Move common into flake.nix (working this time)

This commit is contained in:
Evie Litherland-Smith 2023-06-22 12:48:11 +01:00
parent 7e397ba226
commit 4852bfe01b
2 changed files with 33 additions and 36 deletions

View file

@ -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;
}

View file

@ -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
];