144 lines
4.9 KiB
Nix
144 lines
4.9 KiB
Nix
{
|
|
description = "Thor system configuration";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/release-21.11";
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-21.11";
|
|
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";
|
|
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
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
|
|
, rust-overlay
|
|
, tex2nix
|
|
}:
|
|
let
|
|
system = "x86_64-linux";
|
|
overlays = [
|
|
(import ./rice.nix)
|
|
(rust-overlay.overlay)
|
|
(final: prev: { inherit (tex2nix.packages.${system}) tex2nix; })
|
|
(final: prev: {
|
|
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; };
|
|
})
|
|
(final: prev: { unstable = unstablePkgs; })
|
|
];
|
|
nixpkgsSettings = {
|
|
inherit overlays 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; }
|
|
./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; }
|
|
./thor/hardware-configuration.nix
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
|
./thor/configuration.nix
|
|
];
|
|
|
|
# odinStable = extraModules: nixpkgs.lib.nixosSystem {
|
|
# inherit system;
|
|
# modules = odinBaseModules ++ [
|
|
# home-manager.nixosModules.home-manager
|
|
# homeManagerSettings
|
|
# { home-manager.users.bertof = import ./home_manager/odin.nix; }
|
|
# ] ++ extraModules;
|
|
# };
|
|
|
|
odinUnstable = extraModules: unstable.lib.nixosSystem {
|
|
inherit system;
|
|
modules = odinBaseModules ++ [
|
|
home-manager-unstable.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./home_manager/odin.nix; }
|
|
] ++ extraModules;
|
|
};
|
|
|
|
# thorStable = extraModules: nixpkgs.lib.nixosSystem {
|
|
# inherit system;
|
|
# modules = thorBaseModules ++ [
|
|
# home-manager.nixosModules.home-manager
|
|
# homeManagerSettings
|
|
# { home-manager.users.bertof = import ./home_manager/thor.nix; }
|
|
# ] ++ extraModules;
|
|
# };
|
|
|
|
thorUnstable = extraModules: unstable.lib.nixosSystem {
|
|
inherit system;
|
|
modules = thorBaseModules ++ [
|
|
home-manager-unstable.nixosModules.home-manager
|
|
homeManagerSettings
|
|
{ home-manager.users.bertof = import ./home_manager/thor.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-unstable;
|
|
|
|
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];
|
|
};
|
|
};
|
|
}
|