nixos-configs/common/default.nix
matt1432 63be8a848c
All checks were successful
Discord / discord commits (push) Has been skipped
fix: use nix 2.21.3
2024-05-05 16:45:35 -04:00

137 lines
2.7 KiB
Nix

{
config,
home-manager,
lib,
nh,
nix-melt,
nur,
nurl,
pkgs,
...
} @ inputs: {
imports = [
./vars
./modules
./pkgs
nur.nixosModules.nur
home-manager.nixosModules.home-manager
../modules/arion
../modules/borgbackup
../modules/nvidia.nix
];
nixpkgs = {
config.allowUnfree = true;
overlays = import ./overlays inputs;
};
boot.tmp.useTmpfs = true;
nix = {
# Keep a version that works with nix-eval-jobs
package = pkgs.nixVersions.git.overrideAttrs (oldAttrs: {
pname = "nix";
version = "2.21.3";
src = pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "60824fa97c588a0faf68ea61260a47e388b0a4e5";
sha256 = "10z/SoidVl9/lh56cMLj7ntJZHtVrumFvmn1YEqXmaM=";
};
});
# 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;
# remote building
trusted-users = ["matt" "nixremote"];
};
};
programs.nh = {
enable = true;
package = nh.packages.${pkgs.system}.default;
# weekly cleanup
clean = {
enable = true;
extraArgs = "--keep-since 30d";
};
};
services = {
fwupd.enable = true;
xserver.xkb = {
layout = "ca";
variant = "multix";
};
};
home-manager = let
inherit (config.vars) mainUser;
mainUserConf = config.home-manager.users.${mainUser};
default = {
imports = [
# Make the vars be the same on Nix and HM
{
options.vars = lib.mkOption {
type = lib.types.attrs;
readOnly = true;
default = config.vars;
};
}
{
programs.bash.sessionVariables = {
FLAKE = config.environment.variables.FLAKE;
};
}
nur.hmModules.nur
./home
./home/trash-d
./pkgs
];
home.packages =
[
nix-melt.packages.${pkgs.system}.default
nurl.packages.${pkgs.system}.default
]
++ (with config.nur.repos.rycee; [
mozilla-addons-to-nix
]);
};
in {
users = {
root =
default
// {
home.stateVersion = mainUserConf.home.stateVersion;
};
greeter =
lib.mkIf (config.services.greetd.enable)
(default
// {
home.stateVersion = mainUserConf.home.stateVersion;
});
${mainUser} = default;
};
};
}