nixos-configs/common/default.nix

115 lines
2.1 KiB
Nix
Raw Normal View History

2023-11-22 15:33:16 -05:00
{
config,
2023-12-03 04:50:17 -05:00
home-manager,
2023-11-22 15:33:16 -05:00
nh,
nix-melt,
nur,
2023-11-22 15:33:16 -05:00
nurl,
pkgs,
...
} @ inputs: {
2023-10-15 14:43:23 -04:00
imports = [
./vars
./modules
./pkgs
nur.nixosModules.nur
nh.nixosModules.default
2023-12-03 04:50:17 -05:00
home-manager.nixosModules.home-manager
../modules/arion
2024-03-02 22:04:23 -05:00
../modules/borgbackup
../modules/nvidia.nix
2023-10-15 14:43:23 -04:00
];
nixpkgs = {
config.allowUnfree = true;
overlays = import ./overlays inputs;
};
2023-12-03 02:22:38 -05:00
boot.tmp.cleanOnBoot = true;
nix = {
# Allow deleting store files with '.' in the name
2024-03-22 20:36:08 -04:00
package = pkgs.nix.overrideAttrs (oldAttrs: {
patches =
(oldAttrs.patches or [])
++ [
./overlays/nix/patch
];
});
# Edit nix.conf
settings = {
# Store
keep-outputs = true;
keep-derivations = true;
auto-optimise-store = true;
# Commands
experimental-features = ["nix-command" "flakes"];
http-connections = 0; # unlimited for local cache
warn-dirty = false;
show-trace = true;
2023-12-20 03:47:22 -05:00
# remote building
trusted-users = ["matt" "nixremote"];
};
};
2023-11-19 15:32:28 -05:00
nh = {
enable = true;
# weekly cleanup
clean = {
enable = true;
extraArgs = "--keep-since 30d";
};
2023-11-19 15:32:28 -05:00
};
environment.variables.FLAKE = "/home/matt/.nix";
2023-11-30 17:01:46 -05:00
services = {
fwupd.enable = true;
xserver.xkb = {
2023-11-30 17:01:46 -05:00
layout = "ca";
variant = "multix";
2023-11-30 17:01:46 -05:00
};
};
2023-10-15 14:30:30 -04:00
home-manager.users = let
inherit (config.vars) mainUser;
2024-01-04 03:39:14 -05:00
mainUserConf = config.home-manager.users.${mainUser};
2023-10-15 14:30:30 -04:00
default = {
imports = [
2023-12-08 12:48:48 -05:00
# Make the vars be the same on Nix and HM
./vars
{vars = config.vars;}
2023-12-08 12:48:48 -05:00
2023-10-15 14:43:23 -04:00
nur.hmModules.nur
2023-11-22 14:36:42 -05:00
./home
2023-12-23 22:57:43 -05:00
./home/trash-d
./pkgs
2023-10-15 14:30:30 -04:00
];
2023-11-22 15:33:16 -05:00
home.packages =
[
2023-12-08 12:48:48 -05:00
nix-melt.packages.${pkgs.system}.default
nurl.packages.${pkgs.system}.default
2023-11-22 15:33:16 -05:00
]
++ (with config.nur.repos.rycee; [
mozilla-addons-to-nix
]);
2023-10-15 14:30:30 -04:00
};
in {
2024-01-04 03:39:14 -05:00
root =
default
// {
home.stateVersion = mainUserConf.home.stateVersion;
};
# TODO: make user an array?
2024-01-04 03:39:14 -05:00
${mainUser} = default;
2023-10-15 14:30:30 -04:00
};
2023-10-15 14:43:23 -04:00
}