flake restructure

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-07-23 17:35:57 +02:00
parent ad784f41f9
commit 1e0af7a61b
15 changed files with 802 additions and 884 deletions

View File

@@ -60,10 +60,6 @@
hardware.bluetooth.powerOnBoot = true; # hardware.bluetooth.powerOnBoot = true; #
services.blueman.enable = true; services.blueman.enable = true;
nixpkgs.config.allowUnfree = true;
# nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) allowed.unfree-packages;
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

43
flake-modules/allowed.nix Normal file
View File

@@ -0,0 +1,43 @@
{
unfree = [
"discord"
"spotify"
"obsidian"
"zoom-us"
"zoom"
# since the predicate ist to be set in the flake and not in a module
# it is impossible to make the list dynamic and respect nvidia.enable
"nvidia-x11"
"nvidia-settings"
"nvidia-persistenced"
"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"
];
inecure = [
# "electron-25.9.0"
];
}

4
flake-modules/nvidia.nix Normal file
View File

@@ -0,0 +1,4 @@
{
enable = false;
prime = false;
}

59
flake-modules/rice.nix Normal file
View File

@@ -0,0 +1,59 @@
pkgs: rec {
lib = import ../nxlib/ricelib.nix pkgs.lib;
transparency = 0.8;
rounding = 10;
gap-size = 10;
border-width = 3;
color =
let
dark = (-0.5);
bright = (0.5);
alter-set = let f = 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 = 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";
};
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;
};
}

175
flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718642173, "lastModified": 1720553729,
"narHash": "sha256-iyj4D6c77uROAH9QdZjPd9SKnS/DuACMESqaEKnBgI8=", "narHash": "sha256-9aM4MCBJn4UstcsSdukOFTxg79keUMTw9Kmqr7Wsfmw=",
"owner": "KZDKM", "owner": "KZDKM",
"repo": "Hyprspace", "repo": "Hyprspace",
"rev": "2f3edb68f47a8f5d99d10b322e9a85a285f53cc7", "rev": "e8662093ae5b6e13a3cf1145d21d4804a3e84aeb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -20,6 +20,39 @@
"type": "github" "type": "github"
} }
}, },
"aquamarine": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"hyprwayland-scanner": [
"hyprland",
"hyprwayland-scanner"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1721571743,
"narHash": "sha256-hat7wggtDISBJD8kTo5MTrT+IsY/Ha2MwgjmqqijoCA=",
"owner": "hyprwm",
"repo": "aquamarine",
"rev": "601f6cf95cbe4fef02dc7faf34bba58566c914e9",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "aquamarine",
"type": "github"
}
},
"crane": { "crane": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@@ -53,29 +86,6 @@
"type": "github" "type": "github"
} }
}, },
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1719875691,
"narHash": "sha256-DtfpH7yivPHcfXV0EL70NwCKlg6nVTZGNngWkPshQjM=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "f2c6c0e41d6c2c82524b9d104bcfd1750a426d1b",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -97,11 +107,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1719877454, "lastModified": 1719994518,
"narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=", "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "4e3583423212f9303aa1a6337f8dffb415920e4f", "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -132,21 +142,6 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems_2"
}, },
@@ -193,11 +188,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719827385, "lastModified": 1720042825,
"narHash": "sha256-qs+nU20Sm8czHg3bhGCqiH+8e13BJyRrKONW34g3i50=", "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "391ca6e950c2525b4f853cbe29922452c14eda82", "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -223,11 +218,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718450675, "lastModified": 1721330371,
"narHash": "sha256-jpsns6buS4bK+1sF8sL8AaixAiCRjA+nldTKvcwmvUs=", "narHash": "sha256-aYlHTWylczLt6ERJyg6E66Y/XSCbVL7leVcRuJmVbpI=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprcursor", "repo": "hyprcursor",
"rev": "66d5b46ff94efbfa6fa3d1d1b66735f1779c34a6", "rev": "4493a972b48f9c3014befbbf381ed5fff91a65dc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -238,6 +233,7 @@
}, },
"hyprland": { "hyprland": {
"inputs": { "inputs": {
"aquamarine": "aquamarine",
"hyprcursor": "hyprcursor", "hyprcursor": "hyprcursor",
"hyprlang": "hyprlang", "hyprlang": "hyprlang",
"hyprutils": "hyprutils", "hyprutils": "hyprutils",
@@ -247,11 +243,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1719938427, "lastModified": 1721684218,
"narHash": "sha256-b0QtvQtFAtuOVBNPEUYf4V2VNGChTukkrLH/JlCQds8=", "narHash": "sha256-FbFz+F5LJs92s6/DEkhh2h+k8NRqqrs8MGF+GRZWZGo=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "6247a6b537fd1c05ecf35420529fab1adf83143e", "rev": "3c758db95c129ed6ca7ce0c1b5b82ad6e189488d",
"revCount": 4903, "revCount": 4963,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@@ -279,11 +275,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719784423, "lastModified": 1721668405,
"narHash": "sha256-D7O5+nh2Wn9tQPJArWHrDSZeEfBCtj5zTGd86701LPE=", "narHash": "sha256-ZnIXa+jeMXoerhRz/ZJwVoYHaROjcLyQsr1b6JZ2AjQ=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-plugins", "repo": "hyprland-plugins",
"rev": "98cb18c6fcfe8196ef4150d09fbae305b7bb2954", "rev": "4c2cef8326711fbd91b7a313f095545eb50d2a57",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -306,11 +302,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714869498, "lastModified": 1718746314,
"narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=", "narHash": "sha256-HUklK5u86w2Yh9dOkk4FdsL8eehcOZ95jPhLixGDRQY=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "e06482e0e611130cd1929f75e8c1cf679e57d161", "rev": "1b61f0093afff20ab44d88ad707aed8bf2215290",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -335,11 +331,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717881852, "lastModified": 1721324361,
"narHash": "sha256-XeeVoKHQgfKuXoP6q90sUqKyl7EYy3ol2dVZGM+Jj94=", "narHash": "sha256-BiJKO0IIdnSwHQBSrEJlKlFr753urkLE48wtt0UhNG4=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlang", "repo": "hyprlang",
"rev": "ec6938c66253429192274d612912649a0cfe4d28", "rev": "adbefbf49664a6c2c8bf36b6487fd31e3eb68086",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -380,11 +376,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719316102, "lastModified": 1721324102,
"narHash": "sha256-dmRz128j/lJmMuTYeCYPfSBRHHQO3VeH4PbmoyAhHzw=", "narHash": "sha256-WAZ0X6yJW1hFG6otkHBfyJDKRpNP5stsRqdEuHrFRpk=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "1f6bbec5954f623ff8d68e567bddcce97cd2f085", "rev": "962582a090bc233c4de9d9897f46794280288989",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -405,11 +401,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719067853, "lastModified": 1721324119,
"narHash": "sha256-mAnZG/eQy72Fp1ImGtqCgUrDumnR1rMZv2E/zgP4U74=", "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwayland-scanner", "repo": "hyprwayland-scanner",
"rev": "914f083741e694092ee60a39d31f693d0a6dc734", "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -423,7 +419,7 @@
"crane": "crane", "crane": "crane",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"pre-commit-hooks-nix": "pre-commit-hooks-nix", "pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
@@ -445,11 +441,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1719075281, "lastModified": 1721379653,
"narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -489,27 +485,27 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1719663039, "lastModified": 1721524707,
"narHash": "sha256-tXlrgAQygNIy49LDVFuPXlWD2zTQV9/F8pfoqwwPJyo=", "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4a1e673523344f6ccc84b37f4413ad74ea19a119", "rev": "556533a23879fc7e5f98dd2e0b31a6911a213171",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "release-23.11", "ref": "release-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1719848872, "lastModified": 1721562059,
"narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -551,11 +547,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1719838683, "lastModified": 1721548954,
"narHash": "sha256-Zw9rQjHz1ilNIimEXFeVa1ERNRBF8DoXDhLAZq5B4pE=", "narHash": "sha256-7cCC8+Tdq1+3OPyc3+gVo9dzUNkNIQfwSDJ2HSi2u3o=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d032c1a6dfad4eedec7e35e91986becc699d7d69", "rev": "63d37ccd2d178d54e7fb691d7ec76000740ea24a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -598,7 +594,6 @@
"root": { "root": {
"inputs": { "inputs": {
"Hyprspace": "Hyprspace", "Hyprspace": "Hyprspace",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins", "hyprland-plugins": "hyprland-plugins",
@@ -642,11 +637,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1719873517, "lastModified": 1721688883,
"narHash": "sha256-D1dxZmXf6M2h5lNE1m6orojuUawVPjogbGRsqSBX+1g=", "narHash": "sha256-9jsjsRKtJRqNSTXKj9zuDFRf2PGix30nMx9VKyPgD2U=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "a11224af8d824935f363928074b4717ca2e280db", "rev": "aff2f88277dabe695de4773682842c34a0b7fd54",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -702,11 +697,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718619174, "lastModified": 1721648131,
"narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=", "narHash": "sha256-cyyxu/oj4QEFp3CVx2WeXa9T4OAUyynuBJHGkBZSxJI=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623", "rev": "663be9cad424b170b28b9fa8a61042d721007f3b",
"type": "github" "type": "github"
}, },
"original": { "original": {

258
flake.nix
View File

@@ -2,240 +2,66 @@
description = "Multisystem NixOS Flake of Lennart J. Kurzweg"; description = "Multisystem NixOS Flake of Lennart J. Kurzweg";
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05"; nixpkgs = { url = "nixpkgs/nixos-24.05"; };
nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-unstable = { url = "nixpkgs/nixos-unstable"; };
home-manager = { home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
url = "github:nix-community/home-manager/release-24.05"; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
inputs.nixpkgs.follows = "nixpkgs"; lanzaboote = { url = "github:nix-community/lanzaboote/v0.3.0"; };
};
sops-nix = { hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; };
url = "github:Mic92/sops-nix"; hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; };
inputs.nixpkgs.follows = "nixpkgs"; Hyprspace = { url = "github:KZDKM/Hyprspace"; inputs.hyprland.follows = "hyprland"; };
hyprswitch = { url = "github:h3rmt/hyprswitch/release"; };
# firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; };
}; };
hyprland = { outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs: let
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";
# 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";
};
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs:
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
user = "nx2"; user = "nx2";
nvidia = { config = { allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; };
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" pkgs = import nixpkgs { inherit system config; };
"spotify" pkgs-unstable = import nixpkgs-unstable { inherit system config; };
"obsidian"
"zoom-us"
"zoom"
] ++ nvidia.unfree;
inecure-packages = [
"electron-25.9.0"
];
};
nvidia-set = import ./flake-modules/nvidia.nix;
secrets = import ./git-crypt/secrets.nix; secrets = import ./git-crypt/secrets.nix;
rice = import ./flake-modules/rice.nix pkgs;
rice = rec { in {
lib = import ./nxlib/ricelib.nix { lib = nixpkgs.lib; }; nixosConfigurations = let
transparency = 0.8; make-nixos-system = host: nixpkgs.lib.nixosSystem {
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; inherit system;
modules = [ ./configuration.nix ]; modules = [ ./configuration.nix ];
specialArgs = { inherit inputs user host pkgs-unstable allowed secrets rice nvidia; }; specialArgs = let
nvidia = nvidia-set // {
enable = if (host == "NxXPS" || host == "NxNORTH") then true else false;
prime = if (host == "NxXPS") then true else false;
}; };
NxNORTH = let host = "NxNORTH"; in nixpkgs.lib.nixosSystem { in { inherit inputs user host pkgs-unstable secrets rice nvidia; };
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; };
}; };
in {
NxXPS = make-nixos-system "NxXPS";
NxNORTH = make-nixos-system "NxNORTH";
NxACE = make-nixos-system "NxACE";
}; };
homeConfigurations = { homeConfigurations = let
"${user}@NxXPS" = let host = "NxXPS"; in home-manager.lib.homeManagerConfiguration { make-home-configuration = host: user: home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ ./home.nix ]; modules = [ ./home.nix ];
extraSpecialArgs = { inherit inputs system user host allowed secrets pkgs-unstable rice nvidia; }; extraSpecialArgs = let
nvidia = nvidia-set // {
enable = if (host == "NxXPS" || host == "NxNORTH") then true else false;
prime = if (host == "NxXPS") then true else false;
}; };
"${user}@NxNORTH" = let host = "NxNORTH"; in home-manager.lib.homeManagerConfiguration { in { inherit inputs system user host pkgs-unstable rice secrets nvidia; };
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; };
}; };
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";
}; };
}; };
} }

View File

@@ -1,11 +1,12 @@
{ config, pkgs, pkgs-unstable, lib, host, user, allowed, ... }: { pkgs, lib, host, ... }:
lib.mkIf (host != "NxACE") lib.mkIf (host != "NxACE")
{ {
home.packages = [ home = {
pkgs-unstable.vesktop packages = with pkgs; [
vesktop
]; ];
home.file.".config/vesktop/settings/settings.json".text = '' file.".config/vesktop/settings/settings.json".text = ''
{ {
"notifyAboutUpdates": true, "notifyAboutUpdates": true,
"autoUpdate": false, "autoUpdate": false,
@@ -487,6 +488,7 @@ lib.mkIf (host != "NxACE")
} }
} }
''; '';
};
} }

View File

@@ -2,7 +2,7 @@
{ {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
nixfmt # nix formater nixfmt-classic # nix formater
nil # nix language server nil # nix language server
python311Packages.python-lsp-server python311Packages.python-lsp-server
lldb # debugger for llvm stuff lldb # debugger for llvm stuff

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, system, user, host, allowed, secrets, ... }: { pkgs, lib, host, secrets, ... }:
lib.mkIf (host != "NxACE") lib.mkIf (host != "NxACE")
{ {
home.packages = [ home.packages = [

View File

@@ -1,4 +1,4 @@
{ config, pkgs, pkgs-unstable, lib, system, inputs, host, user, rice, allowed, secrets, ... }: { pkgs, pkgs-unstable, lib, host, user, ... }:
{ {
imports = [ imports = [
@@ -62,10 +62,6 @@
home.username = user; home.username = user;
home.homeDirectory = "/home/${user}"; home.homeDirectory = "/home/${user}";
home.stateVersion = "24.05"; home.stateVersion = "24.05";
nixpkgs.config = {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) allowed.unfree-packages;
permittedInsecurePackages = allowed.inecure-packages;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
chromium chromium

View File

@@ -1,4 +1,4 @@
{ lib, ... }: lib:
let let
# takes in "ff0044" (no hash!) and returns { r = "ff", g = "00", b = "44" } # takes in "ff0044" (no hash!) and returns { r = "ff", g = "00", b = "44" }
slice-hex = hex: with builtins; { r = substring 0 2 hex; g = substring 2 2 hex; b = substring 4 2 hex; }; slice-hex = hex: with builtins; { r = substring 0 2 hex; g = substring 2 2 hex; b = substring 4 2 hex; };

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, user, allowed, secrets, ... }: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View File

@@ -1,6 +1,6 @@
{ config, pkgs, pkgs-unstable, lib, nvidia, ... }: { config, pkgs, lib, nvidia, ... }:
lib.mkIf nvidia.enable
{ {
config = lib.mkIf nvidia.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
lshw lshw
glxinfo glxinfo
@@ -11,7 +11,7 @@
export __VK_LAYER_NV_optimus=NVIDIA_only export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@" exec "$@"
'') '')
] ++ [ # ] ++ [
# pkgs-unstable.nvtopPackages.intel # pkgs-unstable.nvtopPackages.intel
# pkgs-unstable.nvtopPackages.nvidia # pkgs-unstable.nvtopPackages.nvidia
]; ];
@@ -41,7 +41,7 @@
# Fine-grained power management. Turns off GPU when not in use. # Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer). # Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = true; powerManagement.finegrained = nvidia.prime;
# Use the NVidia open source kernel module (not to be confused with the # Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver). # independent third-party "nouveau" open source driver).
@@ -65,5 +65,4 @@
driSupport32Bit = true; driSupport32Bit = true;
}; };
}; };
};
} }

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, system, user, allowed, secrets, ... }: { config, pkgs, lib, ... }:
{ {
services.pipewire = { services.pipewire = {

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, system, host, user, allowed, secrets, ... }: { pkgs, lib, host, user, ... }:
{ {
users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish
@@ -10,13 +10,11 @@
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID1RPCcS8DtIf75a2FEW4d8X6WTVeLlmretoLqppvZlJ" # From [A] GPG Sub Key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID1RPCcS8DtIf75a2FEW4d8X6WTVeLlmretoLqppvZlJ" # From [A] GPG Sub Key
]; ];
packages = with pkgs; []; # all in home.nix
}; };
users.users.tv = lib.mkIf (host == "NxACE") { users.users.tv = lib.mkIf (host == "NxACE") {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "networkmanager" "audio" "video" "uinput" ]; extraGroups = [ "networkmanager" "audio" "video" "uinput" ];
useDefaultShell = true; useDefaultShell = true;
packages = with pkgs; []; # all in home.nix
}; };