nixos configs
1{
2 description = "home manager flake";
3
4 inputs = {
5 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
6 flake-utils.url = "github:numtide/flake-utils";
7
8 home-manager = {
9 url = "github:nix-community/home-manager";
10 inputs.nixpkgs.follows = "nixpkgs";
11 };
12
13 hypr-contrib = {
14 url = "github:hyprwm/contrib";
15 };
16
17 iff-dwm = {
18 url = "github:iff/dwm/nixos";
19 flake = false;
20 };
21
22 osh-oxy = {
23 url = "github:iff/osh-oxy";
24 inputs.nixpkgs.follows = "nixpkgs";
25 flake = true;
26 };
27
28 nihilistic-nvim = {
29 url = "github:iff/nihilistic-nvim";
30 inputs.nixpkgs.follows = "nixpkgs";
31 flake = true;
32 };
33
34 zsh-syntax-highlighting = {
35 url = "github:zsh-users/zsh-syntax-highlighting";
36 flake = false;
37 };
38
39 ltstatus = {
40 url = "github:dkuettel/ltstatus/main";
41 };
42
43 nd = {
44 url = "github:dkuettel/nd/main";
45 };
46 };
47
48 nixConfig = {
49 extra-substituters = [
50 "https://iff-dotfiles.cachix.org"
51 ];
52 extra-trusted-public-keys = [
53 "iff-dotfiles.cachix.org-1:9PzCJ44z3MuyvrvjkbbMWCDl5Rrf9nt3OZHq446Wn58="
54 ];
55 extra-experimental-features = "nix-command flakes";
56 };
57
58 outputs =
59 {
60 self,
61 flake-utils,
62 home-manager,
63 ...
64 }@inputs:
65 with self.lib;
66
67 let
68 forEachSystem = genAttrs [
69 "x86_64-linux"
70 "aarch64-darwin"
71 ];
72 pkgsBySystem = forEachSystem (
73 system:
74 import inputs.nixpkgs {
75 inherit system;
76
77 config.allowUnfreePredicate =
78 pkg:
79 builtins.elem (self.lib.getName pkg) [
80 "1password"
81 "1password-gui"
82 "1password-cli"
83 "claude-code"
84 "google-chrome"
85 "keymapp"
86 "nvidia-settings"
87 "nvidia-x11"
88 "roam-research"
89 "spotify"
90 "steam"
91 "steam-unwrapped"
92 "slack"
93
94 # for cuda
95 "cuda_cudart"
96 "libcublas"
97 "cuda_cccl"
98 "cuda_nvcc"
99 "libcurand"
100 "libcusparse"
101 "libnvjitlink"
102 "libcufft"
103 "cudnn"
104 "cuda_nvrtc"
105 #
106 "cuda-merged"
107 "cuda_cuobjdump"
108 "cuda_gdb"
109 "cuda_nvdisasm"
110 "cuda_nvprune"
111 "cuda_cupti"
112 "cuda_cuxxfilt"
113 "cuda_nvml_dev"
114 "cuda_nvtx"
115 "cuda_profiler_api"
116 "cuda_sanitizer_api"
117 "libcusolver"
118 "libnpp"
119 ];
120 # config.cudaSupport = true;
121 }
122 );
123
124 in
125 {
126 inherit pkgsBySystem;
127 lib = import ./lib { inherit inputs; } // inputs.nixpkgs.lib;
128
129 homeConfigurations = mapAttrs' intoHomeManager {
130 urithiru = {
131 system = "aarch64-darwin";
132 };
133 };
134
135 nixosConfigurations = mapAttrs' intoNixOs {
136 kharbranth = { };
137 };
138
139 # CI build helper
140 top =
141 let
142 systems = genAttrs (builtins.attrNames inputs.self.nixosConfigurations) (
143 attr: inputs.self.nixosConfigurations.${attr}.config.system.build.toplevel
144 );
145 homes = genAttrs (builtins.attrNames inputs.self.homeConfigurations) (
146 attr: inputs.self.homeConfigurations.${attr}.activationPackage
147 );
148 in
149 systems // homes;
150 };
151}