flake restructure
This commit is contained in:
282
flake.nix
282
flake.nix
@@ -2,240 +2,66 @@
|
||||
description = "Multisystem NixOS Flake of Lennart J. Kurzweg";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-24.05";
|
||||
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-24.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixpkgs = { url = "nixpkgs/nixos-24.05"; };
|
||||
nixpkgs-unstable = { url = "nixpkgs/nixos-unstable"; };
|
||||
home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
lanzaboote = { url = "github:nix-community/lanzaboote/v0.3.0"; };
|
||||
|
||||
hyprland = {
|
||||
url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
||||
# url = "github:hyprwm/Hyprland";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
hyprland-plugins = {
|
||||
url = "github:hyprwm/hyprland-plugins";
|
||||
inputs.hyprland.follows = "hyprland";
|
||||
};
|
||||
Hyprspace = {
|
||||
url = "github:KZDKM/Hyprspace";
|
||||
inputs.hyprland.follows = "hyprland";
|
||||
};
|
||||
hyprswitch.url = "github:h3rmt/hyprswitch/release";
|
||||
hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; };
|
||||
hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; };
|
||||
Hyprspace = { url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; };
|
||||
hyprswitch = { url = "github:h3rmt/hyprswitch/release"; };
|
||||
|
||||
# nixvim = {
|
||||
# url = "github:nix-community/nixvim/nixos-23.11";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# };
|
||||
lanzaboote = {
|
||||
url = "github:nix-community/lanzaboote/v0.3.0";
|
||||
# inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
#arion = {
|
||||
# url = "github:hercules-ci/arion";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
#};
|
||||
firefox-addons = {
|
||||
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# yazi.url = "github:sxyazi/yazi";
|
||||
# firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs: let
|
||||
system = "x86_64-linux";
|
||||
user = "nx2";
|
||||
|
||||
user = "nx2";
|
||||
config = { allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; };
|
||||
|
||||
pkgs = import nixpkgs { inherit system config; };
|
||||
pkgs-unstable = import nixpkgs-unstable { inherit system config; };
|
||||
|
||||
nvidia = {
|
||||
enable = true;
|
||||
prime = true;
|
||||
# unfree = if enable then [
|
||||
unfree = [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
"nvidia-persistenced"
|
||||
"cudatoolkit"
|
||||
"cudatoolkit-11.8.0"
|
||||
"cudatoolkit-12.2.2"
|
||||
];
|
||||
# ] else [];
|
||||
};
|
||||
allowed = {
|
||||
unfree-packages = [
|
||||
"cudatoolkit"
|
||||
"cuda-merged"
|
||||
"cuda_cuobjdump"
|
||||
"cuda_gdb"
|
||||
"cuda_nvcc"
|
||||
"cuda_nvdisasm"
|
||||
"cuda_nvprune"
|
||||
"cuda_cccl"
|
||||
"cuda_cudart"
|
||||
"cuda_cupti"
|
||||
"cuda_cuxxfilt"
|
||||
"cuda_nvml_dev"
|
||||
"cuda_nvrtc"
|
||||
"cuda_nvtx"
|
||||
"cuda_profiler_api"
|
||||
"cuda_sanitizer_api"
|
||||
"libcublas"
|
||||
"libcufft"
|
||||
"libcurand"
|
||||
"libcusolver"
|
||||
"libnvjitlink"
|
||||
"libcusparse"
|
||||
"libnpp"
|
||||
|
||||
"discord"
|
||||
"spotify"
|
||||
"obsidian"
|
||||
"zoom-us"
|
||||
"zoom"
|
||||
] ++ nvidia.unfree;
|
||||
|
||||
inecure-packages = [
|
||||
"electron-25.9.0"
|
||||
];
|
||||
};
|
||||
|
||||
secrets = import ./git-crypt/secrets.nix;
|
||||
|
||||
rice = rec {
|
||||
lib = import ./nxlib/ricelib.nix { lib = nixpkgs.lib; };
|
||||
transparency = 0.8;
|
||||
rounding = 10;
|
||||
gap-size = 10;
|
||||
border-width = 3;
|
||||
color =
|
||||
let
|
||||
dark = (-0.5);
|
||||
bright = (0.5);
|
||||
alter-set = let f = rice.lib.alter-luminace-hex; in color-name: color-value: { base = color-value; dark = f color-value dark; bright = f color-value bright; };
|
||||
alter = let f = rice.lib.alter-luminace-hex; in color-value: { base = color-value; dark = f color-value dark; bright = f color-value bright; };
|
||||
ccolor = builtins.mapAttrs alter-set {
|
||||
black = "#000022"; # "#111111" "#001100";
|
||||
white = "#ddddff"; # "#dddddd" "#66dd66";
|
||||
blue = "#4422ff"; # "#3333dd" "#003300";
|
||||
cyan = "#11dddd"; # "#11dddd" "#00dd55";
|
||||
green = "#11dd44"; # "#11dd11" "#11dd11";
|
||||
magenta = "#6622dd"; # "#dd11dd" "#005500";
|
||||
red = "#dd1166"; # "#dd1111" "#00aa00";
|
||||
yellow = "#dd6611"; # "#dddd11" "#ffff00";
|
||||
};
|
||||
xcolor = with ccolor; rec {
|
||||
background = black.dark;
|
||||
foreground = white.base;
|
||||
border = cyan.base;
|
||||
border2 = blue.base;
|
||||
accent = blue;
|
||||
secondary = cyan;
|
||||
tertiary = magenta;
|
||||
special = yellow;
|
||||
weird = green;
|
||||
positive = alter "#00dd00";
|
||||
negative = alter "#dd0000";
|
||||
};
|
||||
# ccolor = builtins.mapAttrs alter-set {
|
||||
# black = "#112200";
|
||||
# white = "#ddffdd";
|
||||
# blue = "#779944";
|
||||
# cyan = "#11ffcc";
|
||||
# green = "#00ff00";
|
||||
# magenta = "#449999";
|
||||
# red = "#dd2200";
|
||||
# yellow = "#ffff11";
|
||||
# };
|
||||
# xcolor = with ccolor; rec {
|
||||
# background = black.dark; # black.dark;
|
||||
# foreground = white.base; # white.base;
|
||||
# border = accent.base; # cyan.base;
|
||||
# border2 = yellow.base; # blue.base;
|
||||
# accent = green; # blue;
|
||||
# secondary = red; # cyan;
|
||||
# tertiary = yellow; # magenta;
|
||||
# special = blue; # yellow;
|
||||
# weird = magenta; # green;
|
||||
# positive = alter "#00dd00"; # alter "#00dd00";
|
||||
# negative = alter "#dd0000"; # alter "#dd0000";
|
||||
# };
|
||||
in ccolor // xcolor;
|
||||
font = {
|
||||
code = {
|
||||
name = "JetBrainsMono-NF";
|
||||
name2 = "JetBrainsMono Nerd Font";
|
||||
package = (pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; });
|
||||
# name = "CascadiaCove-NF";
|
||||
# package = (pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; });
|
||||
};
|
||||
base = {
|
||||
# name = "NewComputerModern08";
|
||||
# package = pkgs.newcomputermodern;
|
||||
name = "Atkinson Hyperlegible";
|
||||
package = pkgs.atkinson-hyperlegible;
|
||||
};
|
||||
};
|
||||
cursor = {
|
||||
name = "Bibata-Original-Classic";
|
||||
package = pkgs.bibata-cursors;
|
||||
size = 24;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
NxXPS = let host = "NxXPS"; in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [ ./configuration.nix ];
|
||||
specialArgs = { inherit inputs user host pkgs-unstable allowed secrets rice nvidia; };
|
||||
};
|
||||
NxNORTH = let host = "NxNORTH"; in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [ ./configuration.nix ];
|
||||
specialArgs = { inherit inputs user host pkgs-unstable allowed secrets rice nvidia; };
|
||||
};
|
||||
NxACE = let host = "NxACE"; nvidia.enable = false; in nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [ ./configuration.nix ];
|
||||
specialArgs = { inherit inputs user host pkgs-unstable allowed secrets rice nvidia; };
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"${user}@NxXPS" = let host = "NxXPS"; in home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./home.nix ];
|
||||
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
|
||||
};
|
||||
"${user}@NxNORTH" = let host = "NxNORTH"; in home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./home.nix ];
|
||||
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
|
||||
};
|
||||
"${user}@NxACE" = let host = "NxACE"; nvidia.enable = false; in home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./home.nix ];
|
||||
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
|
||||
};
|
||||
"tv@NxACE" =
|
||||
let
|
||||
host = "NxACE";
|
||||
user = "tv";
|
||||
nvidia.enable = pkgs.kib.mkForce false;
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./home.nix ];
|
||||
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; };
|
||||
};
|
||||
nvidia-set = import ./flake-modules/nvidia.nix;
|
||||
secrets = import ./git-crypt/secrets.nix;
|
||||
rice = import ./flake-modules/rice.nix pkgs;
|
||||
in {
|
||||
nixosConfigurations = let
|
||||
make-nixos-system = host: nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [ ./configuration.nix ];
|
||||
specialArgs = let
|
||||
nvidia = nvidia-set // {
|
||||
enable = if (host == "NxXPS" || host == "NxNORTH") then true else false;
|
||||
prime = if (host == "NxXPS") then true else false;
|
||||
};
|
||||
in { inherit inputs user host pkgs-unstable secrets rice nvidia; };
|
||||
};
|
||||
in {
|
||||
NxXPS = make-nixos-system "NxXPS";
|
||||
NxNORTH = make-nixos-system "NxNORTH";
|
||||
NxACE = make-nixos-system "NxACE";
|
||||
};
|
||||
|
||||
homeConfigurations = let
|
||||
make-home-configuration = host: user: home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./home.nix ];
|
||||
extraSpecialArgs = let
|
||||
nvidia = nvidia-set // {
|
||||
enable = if (host == "NxXPS" || host == "NxNORTH") then true else false;
|
||||
prime = if (host == "NxXPS") then true else false;
|
||||
};
|
||||
in { inherit inputs system user host pkgs-unstable rice secrets nvidia; };
|
||||
};
|
||||
in {
|
||||
"${user}@NxXPS" = make-home-configuration "NxXPS" user;
|
||||
"${user}@NxNORTH" = make-home-configuration "NxNORTH" user;
|
||||
"${user}@NxACE" = make-home-configuration "NxACE" user;
|
||||
"tv@NxACE" = make-home-configuration "NxACE" "tv";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user