138 lines
5.1 KiB
Nix
138 lines
5.1 KiB
Nix
{
|
|
description = "Multisystem NixOS Flake of Lennart J. Kurzweg";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "nixpkgs/nixos-25.11";
|
|
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
|
nixpkgs-latest.url = "github:nixos/nixpkgs?ref=master";
|
|
nixpkgs24.url = "github:NixOS/nixpkgs/nixos-24.05";
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
home-manager24 ={
|
|
url = "github:nix-community/home-manager/release-24.05";
|
|
inputs.nixpkgs.follows = "nixpkgs24";
|
|
};
|
|
|
|
nix-on-droid = {
|
|
url = "github:nix-community/nix-on-droid/release-24.05";
|
|
inputs.nixpkgs.follows = "nixpkgs24";
|
|
inputs.home-manager.follows = "home-manager24";
|
|
};
|
|
|
|
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
|
|
|
sops-nix ={
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.2";
|
|
|
|
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
|
yazi.url = "github:sxyazi/yazi";
|
|
copyparty.url = "github:9001/copyparty";
|
|
};
|
|
|
|
outputs = { ... }@inputs: with inputs; let
|
|
|
|
system = "x86_64-linux";
|
|
simple-pkgs = import nixpkgs { inherit system; };
|
|
config = { allowUnfreePredicate = pkg: builtins.elem (simple-pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; };
|
|
|
|
hyper-base = rec {
|
|
system = "x86_64-linux";
|
|
user = "nx2";
|
|
domain = "nx2.site";
|
|
home = "/home/${user}";
|
|
webroot = "/var/lib/hugo/nx2site/public";
|
|
pkgs-version = "25.11";
|
|
};
|
|
|
|
get-pkgs = let s = system; in { host, system?s, nixpkgs?inputs.nixpkgs, version?"25.11" }: import nixpkgs {
|
|
inherit system config;
|
|
overlays = [(final: prev: {
|
|
unstable = import nixpkgs-unstable { inherit system config; };
|
|
latest = import nixpkgs-latest { inherit system config; };
|
|
pkgs-version = version;
|
|
})] ++ (if host == "NxACE" then [
|
|
copyparty.overlays.default
|
|
] else []);
|
|
};
|
|
|
|
nvidia-base = import ./flake-modules/nvidia.nix;
|
|
secrets = import ./git-crypt/secrets.nix;
|
|
rice = import ./flake-modules/rice.nix simple-pkgs;
|
|
in {
|
|
nixosConfigurations = let
|
|
make-nixos-system = host: nvidia-settings: nixpkgs.lib.nixosSystem {
|
|
pkgs = get-pkgs { inherit host; };
|
|
modules = [ ./configuration.nix ];
|
|
specialArgs = let
|
|
hyper = hyper-base // { inherit host; nvidia = (nvidia-base // nvidia-settings); };
|
|
in { inherit inputs hyper rice secrets; };
|
|
};
|
|
make-nixos-wsl-system = host: nixpkgs.lib.nixosSystem {
|
|
pkgs = get-pkgs { inherit host; };
|
|
modules = [ ./wsl.nix ];
|
|
specialArgs = let
|
|
hyper = hyper-base // { inherit host; };
|
|
rice = import ./flake-modules/rice.nix pkgs;
|
|
in { inherit inputs hyper rice; };
|
|
};
|
|
in {
|
|
NxXPS = make-nixos-system "NxXPS" { enable = true; prime = true; };
|
|
NxNORTH = make-nixos-system "NxNORTH" { enable = true; prime = false; };
|
|
NxACE = make-nixos-system "NxACE" { enable = false; };
|
|
NxDCS = make-nixos-wsl-system "NxDCS";
|
|
};
|
|
|
|
nixOnDroidConfigurations = let
|
|
makeNODConfiguration = host: nix-on-droid.lib.nixOnDroidConfiguration rec {
|
|
pkgs = let
|
|
options = { inherit host; system = "aarch64-linux"; };
|
|
in (get-pkgs options) //
|
|
(get-pkgs (options // { version = "24.05"; nixpkgs = nixpkgs24; } )
|
|
);
|
|
modules = [ ./nod.nix ];
|
|
home-manager-path = home-manager24.outPath;
|
|
extraSpecialArgs = let
|
|
hyper = hyper-base // {
|
|
inherit host;
|
|
system = "aarch64-linux";
|
|
user = "nix-on-droid";
|
|
home = "/data/data/com.termux.nix/files/home";
|
|
pkgs-version = "24.05";
|
|
};
|
|
rice = import ./flake-modules/rice.nix pkgs;
|
|
in { inherit inputs hyper rice; };
|
|
};
|
|
in { NxS23U = makeNODConfiguration "NxS23U"; };
|
|
|
|
homeConfigurations = let
|
|
make-home-configuration = host: user: nvidia-settings: home-manager.lib.homeManagerConfiguration {
|
|
pkgs = get-pkgs { inherit host; };
|
|
modules = [ ./home.nix ];
|
|
extraSpecialArgs = let
|
|
hyper = hyper-base // { inherit host; nvidia = nvidia-base // nvidia-settings; };
|
|
in { inherit inputs hyper rice secrets; };
|
|
};
|
|
make-shell-configuration = host: user: home-manager.lib.homeManagerConfiguration {
|
|
pkgs = get-pkgs { inherit host; };
|
|
modules = [ ./shell-only.nix ];
|
|
extraSpecialArgs = let
|
|
hyper = hyper-base // { inherit host; };
|
|
in { inherit inputs hyper rice secrets; };
|
|
};
|
|
in {
|
|
"${hyper-base.user}@NxXPS" = make-home-configuration "NxXPS" hyper-base.user { enable = true; prime = true; };
|
|
"${hyper-base.user}@NxNORTH" = make-home-configuration "NxNORTH" hyper-base.user { enable = true; prime = false; };
|
|
"${hyper-base.user}@NxACE" = make-home-configuration "NxACE" hyper-base.user { enable = false; };
|
|
|
|
"${hyper-base.user}@NxDCS" = make-shell-configuration "NxDCS" hyper-base.user;
|
|
};
|
|
};
|
|
}
|