181 lines
6.7 KiB
Nix
181 lines
6.7 KiB
Nix
{
|
|
description = "Thor system configuration";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/release-22.05";
|
|
home-manager = { url = "github:nix-community/home-manager/release-22.05"; inputs.nixpkgs.follows = "nixpkgs"; };
|
|
|
|
unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
home-manager-unstable = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "unstable"; };
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
|
|
|
nix-rice = { url = "github:bertof/nix-rice"; inputs.inxpkgs.follows = "unstable"; inputs.flake-utils.follows = "flake-utils"; };
|
|
pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; };
|
|
tex2nix = { url = github:Mic92/tex2nix; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; };
|
|
};
|
|
|
|
outputs =
|
|
{ self
|
|
, nixpkgs
|
|
, home-manager
|
|
, unstable
|
|
, home-manager-unstable
|
|
, flake-utils
|
|
, nixos-hardware
|
|
, tex2nix
|
|
, nix-rice
|
|
, pre-commit-hooks
|
|
}:
|
|
let
|
|
system = "x86_64-linux";
|
|
overlaysBuilder = system: [
|
|
(nix-rice.overlays.default)
|
|
(import ./rice.nix)
|
|
(_: _: { inherit (tex2nix.packages.${system}) tex2nix; })
|
|
(final: _: {
|
|
update-background = final.callPackage ./custom/update-background { backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+"; };
|
|
lockscreen = final.callPackage ./custom/lockscreen { palette = final.rice.colorPalette; font = final.rice.font.normal; };
|
|
})
|
|
(_: _: { stable = pkgs; })
|
|
(_: _: { unstable = unstablePkgs; })
|
|
];
|
|
nixpkgsSettings = {
|
|
inherit system;
|
|
overlays = overlaysBuilder system;
|
|
config = {
|
|
extraOptions = "experimental-features = nix-command flakes";
|
|
allowUnfree = true;
|
|
permittedInsecurePackages = [ "electron-9.4.4" ]; # authy dependency
|
|
};
|
|
};
|
|
pkgs = import nixpkgs nixpkgsSettings;
|
|
unstablePkgs = import unstable nixpkgsSettings;
|
|
homeManagerSettings = { home-manager = { useGlobalPkgs = true; useUserPackages = true; }; };
|
|
|
|
odinBaseModules = [
|
|
{ nixpkgs = nixpkgsSettings; }
|
|
./nixos_modules/automatic-garbage-collection.nix
|
|
./odin/hardware-configuration.nix
|
|
nixos-hardware.nixosModules.common-cpu-intel
|
|
nixos-hardware.nixosModules.common-pc-laptop
|
|
nixos-hardware.nixosModules.common-pc-laptop-ssd
|
|
./odin/common_configuration.nix
|
|
];
|
|
|
|
thorBaseModules = [
|
|
{ nixpkgs = nixpkgsSettings; }
|
|
./nixos_modules/automatic-garbage-collection.nix
|
|
./thor/hardware-configuration.nix
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
|
./thor/configuration.nix
|
|
];
|
|
|
|
lokiBaseModules = [
|
|
{ nixpkgs = nixpkgsSettings; }
|
|
./nixos_modules/automatic-garbage-collection.nix
|
|
./loki/hardware-configuration.nix
|
|
nixos-hardware.nixosModules.common-cpu-intel
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
|
./loki/configuration.nix
|
|
];
|
|
|
|
odinStable = extraModules: nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
modules = odinBaseModules ++ [
|
|
home-manager.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./odin/hm.nix; }
|
|
] ++ extraModules;
|
|
};
|
|
|
|
odinUnstable = extraModules: unstable.lib.nixosSystem {
|
|
inherit system;
|
|
modules = odinBaseModules ++ [
|
|
home-manager-unstable.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./odin/hm.nix; }
|
|
] ++ extraModules;
|
|
};
|
|
|
|
thorStable = extraModules: nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
modules = thorBaseModules ++ [
|
|
home-manager.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./thod/hm.nix; }
|
|
] ++ extraModules;
|
|
};
|
|
|
|
thorUnstable = extraModules: unstable.lib.nixosSystem {
|
|
inherit system;
|
|
modules = thorBaseModules ++ [
|
|
home-manager-unstable.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./thod/hm.nix; }
|
|
] ++ extraModules;
|
|
};
|
|
|
|
lokiUnstable = extraModules: unstable.lib.nixosSystem {
|
|
inherit system;
|
|
modules = lokiBaseModules ++ [
|
|
home-manager-unstable.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./loki/hm.nix; }
|
|
] ++ extraModules;
|
|
};
|
|
|
|
lokiStable = extraModules: nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
modules = lokiBaseModules ++ [
|
|
home-manager.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./loki/hm.nix; }
|
|
] ++ extraModules;
|
|
};
|
|
|
|
in
|
|
{
|
|
packages.${system} = unstablePkgs;
|
|
|
|
nixosConfigurations = rec {
|
|
|
|
thor = thor-unstable;
|
|
thor-stable = thorStable [ ./nixos_modules/pro_audio.nix ./nixos_modules/sesar.nix ];
|
|
thor-unstable = thorUnstable [ ./nixos_modules/pro_audio.nix ./nixos_modules/sesar.nix ];
|
|
# thor-big-data = thorUnstable [ ./nixos_modules/pro_audio.nix ./nixos_modules/big_data.nix ./nixos_modules/sesar.nix ];
|
|
|
|
odin = odin-intel;
|
|
odin-intel = odin-intel-stable;
|
|
odin-nvidia = odin-nvidia-stable;
|
|
odin-intel-unstable = odinUnstable [ ./odin/configuration-intel.nix ./nixos_modules/pro_audio.nix ./nixos_modules/sesar.nix ];
|
|
odin-nvidia-unstable = odinUnstable [ ./odin/configuration-nvidia.nix ./nixos_modules/pro_audio.nix ./nixos_modules/sesar.nix ];
|
|
odin-intel-stable = odinStable [ ./odin/configuration-intel.nix ./nixos_modules/pro_audio.nix ./nixos_modules/sesar.nix ];
|
|
odin-nvidia-stable = odinStable [ ./odin/configuration-nvidia.nix ./nixos_modules/pro_audio.nix ./nixos_modules/sesar.nix ];
|
|
|
|
loki = loki-stable;
|
|
loki-stable = lokiStable [ ./nixos_modules/dnsmasq.nix ];
|
|
loki-k3s = lokiStable [ ./nixos_modules/k3s.nix ];
|
|
loki-unstable = lokiUnstable [ ];
|
|
|
|
};
|
|
} // (flake-utils.lib.eachDefaultSystem (system:
|
|
let unstablePkgs = import unstable { inherit system; overlays = overlaysBuilder system; };
|
|
in
|
|
rec {
|
|
checks = {
|
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks = { nixpkgs-fmt.enable = true; nix-linter.enable = true; };
|
|
};
|
|
};
|
|
|
|
devShells.default = unstablePkgs.mkShell {
|
|
shellHook = ''
|
|
${self.checks.${system}.pre-commit-check.shellHook}
|
|
'';
|
|
};
|
|
}));
|
|
}
|