290 lines
8.4 KiB
Nix
290 lines
8.4 KiB
Nix
{
|
|
description = "Thor system configuration";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
|
|
nixpkgs-u.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-22.05";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
# home-manager-u = {
|
|
# url = "github:nix-community/home-manager";
|
|
# inputs.nixpkgs.follows = "nixpkgs-u";
|
|
# };
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
# nixos-generators.url = "github:nix-community/nixos-generators";
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
|
nix-rice = {
|
|
url = "github:bertof/nix-rice";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
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
|
|
, nixpkgs-u
|
|
, home-manager
|
|
, deploy-rs
|
|
, flake-utils
|
|
, # , nixos-generators
|
|
nixos-hardware
|
|
, nix-rice
|
|
, pre-commit-hooks
|
|
, tex2nix
|
|
,
|
|
}:
|
|
let
|
|
config = {
|
|
allowUnfree = true;
|
|
extraOptions = "experimental-features = nix-command flakes";
|
|
permittedInsecurePackages = [
|
|
"electron-9.4.4" # authy dependency
|
|
"qtwebkit-5.212.0-alpha4" # mendeley dependency
|
|
];
|
|
};
|
|
|
|
overlays = [
|
|
# Combine stable and unstable packages
|
|
(_: _: {
|
|
stable = import nixpkgs { inherit config overlays; };
|
|
unstable = import nixpkgs-u { inherit config overlays; };
|
|
})
|
|
|
|
# Nix rice
|
|
nix-rice.overlays.default
|
|
(import ./rice.nix)
|
|
|
|
# Flakes packages
|
|
(self: _: {
|
|
clipedit = self.callPackage ./custom/clipedit { };
|
|
update-background = self.callPackage ./custom/update-background {
|
|
backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+";
|
|
};
|
|
lockscreen = self.callPackage ./custom/lockscreen {
|
|
palette = self.rice.colorPalette;
|
|
font = self.rice.font.normal;
|
|
};
|
|
sddm-theme-clairvoyance = self.callPackage ./custom/sddm-theme-clairvoyance {
|
|
wallpaper = ./wallpapers/comfy_waves.jpg;
|
|
};
|
|
})
|
|
];
|
|
|
|
basic = with flake-utils.lib; eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs-u { inherit system config overlays; };
|
|
in
|
|
{
|
|
formatter = pkgs.nixpkgs-fmt;
|
|
|
|
checks = {
|
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks = {
|
|
deadnix.enable = true;
|
|
nixpkgs-fmt.enable = true;
|
|
nix-linter.enable = true;
|
|
statix.enable = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
deploy-rs.packages.${system}.deploy-rs
|
|
];
|
|
shellHook = ''
|
|
${self.checks.${system}.pre-commit-check.shellHook}
|
|
'';
|
|
};
|
|
});
|
|
|
|
commonModules = [
|
|
# Nix configuration
|
|
({ pkgs, ... }: {
|
|
nixpkgs = { inherit overlays config; };
|
|
nix = {
|
|
package = pkgs.nixVersions.stable;
|
|
extraOptions = "experimental-features = nix-command flakes";
|
|
registry = {
|
|
stable = {
|
|
from = {
|
|
id = "stable";
|
|
type = "indirect";
|
|
};
|
|
flake = nixpkgs;
|
|
};
|
|
unstable = {
|
|
from = {
|
|
id = "unstable";
|
|
type = "indirect";
|
|
};
|
|
flake = nixpkgs-u;
|
|
};
|
|
tex2nix = {
|
|
from = {
|
|
id = "tex2nix";
|
|
type = "indirect";
|
|
};
|
|
flake = tex2nix;
|
|
};
|
|
};
|
|
};
|
|
})
|
|
|
|
# Home manager configuration
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
};
|
|
}
|
|
|
|
./nixos_modules/bertof_user.nix
|
|
./nixos_modules/automatic-garbage-collection.nix
|
|
./nixos_modules/automatic-upgrade.nix
|
|
./nixos_modules/zerotier.nix
|
|
];
|
|
|
|
thorConfig = {
|
|
nixosConfigurations = {
|
|
thor = nixpkgs.lib.nixosSystem rec {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
commonModules
|
|
++ [
|
|
{ nixpkgs.config = config // { cudaSupport = true; }; }
|
|
./thor/hardware-configuration.nix
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
|
./thor/configuration.nix
|
|
|
|
./nixos_modules/pro_audio.nix
|
|
./nixos_modules/sesar.nix
|
|
./nixos_modules/pentablet.nix
|
|
|
|
{ home-manager.users.bertof = import ./thor/hm.nix; }
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
odinConfig = {
|
|
nixosConfigurations =
|
|
let
|
|
odinCommonModules = [
|
|
nixos-hardware.nixosModules.common-cpu-intel
|
|
nixos-hardware.nixosModules.common-pc-laptop
|
|
nixos-hardware.nixosModules.common-pc-laptop-ssd
|
|
./odin/hardware-configuration.nix
|
|
./odin/common_configuration.nix
|
|
|
|
./nixos_modules/pro_audio.nix
|
|
./nixos_modules/sesar.nix
|
|
./nixos_modules/pentablet.nix
|
|
|
|
{ home-manager.users.bertof = import ./odin/hm.nix; }
|
|
];
|
|
in
|
|
rec {
|
|
odin-nvidia = nixpkgs.lib.nixosSystem rec {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
commonModules
|
|
++ odinCommonModules
|
|
++ [
|
|
{ nixpkgs.config = config // { cudaSupport = true; }; }
|
|
./odin/configuration-nvidia.nix
|
|
];
|
|
};
|
|
|
|
odin-intel = nixpkgs.lib.nixosSystem rec {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
commonModules
|
|
++ odinCommonModules
|
|
++ [
|
|
./odin/configuration-intel.nix
|
|
];
|
|
};
|
|
|
|
odin = odin-intel;
|
|
};
|
|
};
|
|
|
|
freyaConfig = {
|
|
nixosConfigurations = rec {
|
|
freya = nixpkgs.lib.nixosSystem rec {
|
|
system = "aarch64-linux";
|
|
modules =
|
|
commonModules
|
|
++ [
|
|
nixos-hardware.nixosModules.raspberry-pi."4"
|
|
./freya/hardware-configuration.nix
|
|
./freya/configuration.nix
|
|
{ home-manager.users.bertof = import ./freya/hm.nix; }
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
baldurConfig = {
|
|
nixosConfigurations = rec {
|
|
baldur = nixpkgs.lib.nixosSystem rec {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
commonModules
|
|
++ [
|
|
# nixos-hardware.nixosModules.common-cpu-amd
|
|
# nixos-hardware.nixosModules.common-pc-ssd
|
|
./baldur/hardware-configuration.nix
|
|
./baldur/configuration.nix
|
|
{ home-manager.users.bertof = import ./baldur/hm.nix; }
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
lokiConfig = {
|
|
nixosConfigurations = rec {
|
|
loki = nixpkgs.lib.nixosSystem rec {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
commonModules
|
|
++ [
|
|
nixos-hardware.nixosModules.common-cpu-intel
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
|
./loki/hardware-configuration.nix
|
|
./loki/configuration.nix
|
|
{ home-manager.users.bertof = import ./loki/hm.nix; }
|
|
];
|
|
};
|
|
};
|
|
};
|
|
in
|
|
builtins.foldl' nixpkgs.lib.recursiveUpdate { } [
|
|
basic
|
|
thorConfig
|
|
odinConfig
|
|
freyaConfig
|
|
baldurConfig
|
|
lokiConfig
|
|
];
|
|
}
|