Nix Flakes configuration for MacOS, NixOS and WSL
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

wip: custom lib

+195 -22
-1
README.md
··· 36 36 | :--------: | :-------------------------------: | :------------------: | :---------------: | :--: | :-: | :-------: | :----: | 37 37 | `njord` | - | Apple M2 Pro Chip | Apple M2 Pro Chip | 32Go | 🍎️ | ⌨ | 🟢️ | 38 38 | `loki` | ASUS ROG STRIX B760-I GAMING WIFI | Intel i5 13600kf | Nvidia 4070ti | 32Go | ❄️ | 🎮️ / 🎭️ | 🟢️ | 39 - | `hvedrung` | ⤴️ | ⤴️ | ⤴️ | ⤴️ | 👹️ | 🧨️ / 🎭️ | 🔴️ | 40 39 | `nyx` | Aorus B450 Elite | AMD Ryzen 3 3300X | Nvidia 1060 | 16GO | ❄️ | 🎮️ / ⌨️ | 🟢️ | 41 40 | `beowulf` | HP ProDesk 400 G1 DM | Intel Pentium G3250T | - | 8Go | ❄️ | 💾️ | 🟠 | 42 41 | `vali` | WSL | Intel i5-1135G7 | - | 16Go | ❄️ | ⌨️ | 🟠 |
+45 -10
flake.lock
··· 7 7 ] 8 8 }, 9 9 "locked": { 10 - "lastModified": 1735478292, 11 - "narHash": "sha256-Ys9pSP9ch0SthhpbjnkCSJ9ZLfaNKnt/dcy7swjmS1A=", 10 + "lastModified": 1735685839, 11 + "narHash": "sha256-62xAPSs5VRZoPH7eRanUn5S5vZEd+8vM4bD5I+zxokc=", 12 12 "owner": "LnL7", 13 13 "repo": "nix-darwin", 14 - "rev": "71a3a075e3229a7518d76636bb762aef2bcb73ac", 14 + "rev": "6a1fdb2a1204c0de038847b601cff5012e162b5e", 15 15 "type": "github" 16 16 }, 17 17 "original": { ··· 43 43 }, 44 44 "nixpkgs": { 45 45 "locked": { 46 - "lastModified": 1735412871, 47 - "narHash": "sha256-Qoz0ow6jDGUIBHxduc7Y1cjYFS71tvEGJV5Src/mj98=", 46 + "lastModified": 1735531152, 47 + "narHash": "sha256-As8I+ebItDKtboWgDXYZSIjGlKeqiLBvjxsQHUmAf1Q=", 48 48 "owner": "nixos", 49 49 "repo": "nixpkgs", 50 - "rev": "9f94733f93e4fe6e82f516efae007096e4ab5a21", 50 + "rev": "3ffbbdbac0566a0977da3d2657b89cbcfe9a173b", 51 51 "type": "github" 52 52 }, 53 53 "original": { 54 54 "owner": "nixos", 55 55 "ref": "nixos-24.11", 56 + "repo": "nixpkgs", 57 + "type": "github" 58 + } 59 + }, 60 + "nixpkgs_2": { 61 + "locked": { 62 + "lastModified": 1735471104, 63 + "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=", 64 + "owner": "nixos", 65 + "repo": "nixpkgs", 66 + "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4", 67 + "type": "github" 68 + }, 69 + "original": { 70 + "owner": "nixos", 71 + "ref": "nixos-unstable", 56 72 "repo": "nixpkgs", 57 73 "type": "github" 58 74 } ··· 62 78 "darwin": "darwin", 63 79 "home-manager": "home-manager", 64 80 "nixpkgs": "nixpkgs", 65 - "unstable": "unstable" 81 + "unstable": "unstable", 82 + "zen-browser": "zen-browser" 66 83 } 67 84 }, 68 85 "unstable": { 69 86 "locked": { 70 - "lastModified": 1735523292, 71 - "narHash": "sha256-opBsbR/nrGxiiF6XzlVluiHYb6yN/hEwv+lBWTy9xoM=", 87 + "lastModified": 1735617354, 88 + "narHash": "sha256-5zJyv66q68QZJZsXtmjDBazGnF0id593VSy+8eSckoo=", 72 89 "owner": "nixos", 73 90 "repo": "nixpkgs", 74 - "rev": "6d97d419e5a9b36e6293887a89a078cf85f5a61b", 91 + "rev": "69b9a8c860bdbb977adfa9c5e817ccb717884182", 75 92 "type": "github" 76 93 }, 77 94 "original": { 78 95 "owner": "nixos", 79 96 "ref": "nixpkgs-unstable", 80 97 "repo": "nixpkgs", 98 + "type": "github" 99 + } 100 + }, 101 + "zen-browser": { 102 + "inputs": { 103 + "nixpkgs": "nixpkgs_2" 104 + }, 105 + "locked": { 106 + "lastModified": 1735712737, 107 + "narHash": "sha256-KDVdqZaTsIFnI7sWDTq/ubeNns0aGZ4ttH2qHdZgwds=", 108 + "owner": "0xc000022070", 109 + "repo": "zen-browser-flake", 110 + "rev": "45acccc0bfcedb9a7c1b6eaf0efcc97442b57f0f", 111 + "type": "github" 112 + }, 113 + "original": { 114 + "owner": "0xc000022070", 115 + "repo": "zen-browser-flake", 81 116 "type": "github" 82 117 } 83 118 }
+3 -2
flake.nix
··· 16 16 17 17 home-manager.url = "github:nix-community/home-manager/release-24.11"; 18 18 home-manager.inputs.nixpkgs.follows = "nixpkgs"; 19 + 20 + zen-browser.url = "github:0xc000022070/zen-browser-flake"; 19 21 }; 20 22 21 23 outputs = { self, nixpkgs, darwin, ... }@inputs: ··· 27 29 loki = nixpkgs.lib.nixosSystem { 28 30 system = "x86_64-linux"; 29 31 specialArgs = { inherit inputs self; }; 30 - modules = [ ./hosts/x86_64-linux/loki 31 - ]; 32 + modules = [ ./hosts/x86_64-linux/loki ]; 32 33 }; 33 34 34 35 # TODO: rework configuration not being usable at the moment
-4
hosts/x86_64-bsd/hvedrung/default.nix
··· 1 - { self, inputs, pkgs, ... }: 2 - { 3 - # 4 - }
hosts/x86_64-linux/beowulf/default.nix archives/beowulf/default.nix
+10 -5
hosts/x86_64-linux/loki/default.nix
··· 9 9 # Window manager 10 10 services.windowManager.river.enable = true; 11 11 12 - programs.firefox.enable = true; 13 - 14 12 # Home Manager 15 13 home-manager.useGlobalPkgs = true; 16 14 home-manager.useUserPackages = true; ··· 110 108 git 111 109 mangohud 112 110 protonup 113 - kitty 114 111 vlc 115 112 pavucontrol 116 113 114 + inputs.zen-browser.packages."${system}".default 115 + 117 116 # For gaming purposes 118 117 ananicy-cpp 119 118 ananicy-rules-cachyos 120 119 ]; 121 120 121 + # Unlock 1password browser extension for zen 122 + environment.etc."1password/custom_allowed_browsers" = { 123 + text = ".zen-wrapped"; 124 + mode = "0755"; 125 + }; 126 + 122 127 # Define a user account. Don't forget to set a password with ‘passwd’. 123 128 users.users.cosmeak = { 124 129 isNormalUser = true; ··· 131 136 132 137 # Enable unfree packages 133 138 nixpkgs.config.allowUnfree = true; 134 - nixpkgs.overlays = [ self.outputs.overlays.unstable-packages self.outputs.overlays.dwl ]; 139 + # nixpkgs.overlays = [ self.outputs.overlays.unstable-packages self.outputs.overlays.dwl ]; 135 140 136 141 # Perform garbage collection weekly to maintain low disk usage 137 142 nix.gc = { ··· 148 153 nix.settings.auto-optimise-store = true; 149 154 150 155 # Enable flakes 151 - nix.settings.experimental-features = [ "nix-command" "flakes" ]; 156 + nix.settings.experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; 152 157 153 158 # This value determines the NixOS release from which the default 154 159 # settings for stateful data, like file locations and database versions
hosts/x86_64-linux/loki/disks.nix

This is a binary file and will not be displayed.

hosts/x86_64-linux/nyx/default.nix archives/nyx/default.nix
hosts/x86_64-linux/nyx/hardware.nix archives/nyx/hardware.nix
hosts/x86_64-linux/vali/configuration.nix archives/vali/configuration.nix
+137
lib/default.nix
··· 1 + { self, inputs, ... }: 2 + let inherit (inputs.nixpkgs) lib; in 3 + rec { 4 + ## FileSystem 5 + ## Help manage file and access to it 6 + fs = rec { 7 + ## Match if type is a directory 8 + #@ String -> Boolean 9 + isDirectory = type: type == "directory"; 10 + 11 + ## Match if type is a file 12 + #@ String -> Boolean 13 + isFile = type: type == "regular"; 14 + 15 + ## Get directories at a given path 16 + #@ Path -> []Path 17 + getDirectories = path: 18 + builtins.readDir path 19 + |> lib.filterAttrs (_: type: type |> isDirectory) 20 + |> lib.mapAttrsToList(name: _: "${path}/${name}"); 21 + 22 + ## Get files at a given path 23 + #@ Path -> []Path 24 + getFiles = path: 25 + builtins.readDir path 26 + |> lib.filterAttrs (_: type: type |> isFile) 27 + |> lib.mapAttrsToList(name: _: "${path}/${name}"); 28 + 29 + ## Get files in all folders at a giver path 30 + #@ Path -> []Path 31 + getFilesRecursively = path: let 32 + entries = builtins.readDir path |> lib.filterAttrs (name: type: (type |> isDirectory) || (type |> isFile)); 33 + mapFile = name: type: let 34 + path' = "${path}/${name}"; 35 + in 36 + if type == "directory" 37 + then getFilesRecursively path' 38 + else path'; 39 + files = lib.flatten (lib.mapAttrsToList mapFile entries); 40 + in files; 41 + 42 + ## Get the default file in the directory if exists 43 + #@ Path -> Path|null 44 + getDefaultFile = path: let path = "${path}/default.nix"; in if builtins.pathExists path then path else null; 45 + 46 + ## Get all default files from a folder recursively 47 + #@ Path -> []Path 48 + getDefaultFiles = path: getFilesRecursively path |> builtins.filter (name: builtins.basNameOf name == "default.nix"); 49 + }; 50 + 51 + module = rec { 52 + getCommonModules = getDefaultFiles ./../modules/common; 53 + getNixosModules = getDefaultFiles ./../modules/nixos ++ getCommonModules; 54 + getDarwinModules = getDefaultFiles ./../modules/darwin ++ getCommonModules; 55 + getHomeManagerModules = getDefaultFiles ./../modules/home-manager; 56 + }; 57 + 58 + overlay = rec { 59 + getOverlays = []; 60 + }; 61 + 62 + ## Hosts 63 + ## Help manage hosts builds 64 + host = rec { 65 + ## Check if a system is Linux 66 + #@ String -> Bool 67 + isLinux = lib.hasInfix "linux"; 68 + 69 + ## Check if a system is MacOS 70 + #@ String -> Bool 71 + isDarwin = lib.hasInfix "darwin"; 72 + 73 + ## Get structured data about all hosts for a system 74 + #@ String -> [Attrs] 75 + getSystemHostsInformations = systemPath: let 76 + hosts = fs.getDirectories systemPath; 77 + mkHostInformations = path: rec { 78 + system = builtins.basNameOf systemPath; 79 + hostname = builtins.basNameOf path; 80 + path = fs.getDefaultFile path; 81 + builder = getHostBuilder system; 82 + output = getHostSystemOutput system; 83 + }; 84 + hostsInformations = builtins.map hosts; 85 + in hostsInformations; 86 + 87 + ## Get the name of the system output 88 + #@ String -> String 89 + getHostSystemOutput = system: if system |> isDarwin then "darwinConfiguration" else "NixosConfiguration"; 90 + 91 + ## Get the system host builder 92 + #@ String -> Functions 93 + getHostBuilder = system: let 94 + linuxBuilder = args: lib.nixosSystem (args // { 95 + modules = args.modules ++ []; 96 + }); 97 + darwinBuilder = args: inputs.darwin.lib.darwinSystem (args // { 98 + modules = args.modules ++ []; 99 + }); 100 + in 101 + if system |> isDarwin 102 + then darwinBuilder 103 + else linuxBuilder; 104 + 105 + ## Create output for a host 106 + #@ Attrs -> Attrs 107 + mkHost = { 108 + system, 109 + hostname, 110 + path, 111 + builder, 112 + output 113 + }: { 114 + ${output} = ${builder} { 115 + system = system; 116 + specialArgs = { inherit inputs self; }; 117 + modules = [ path ]; 118 + }; 119 + }; 120 + 121 + ## Create all available hosts 122 + #@ Attrs -> Attrs 123 + mkHosts = let 124 + systems = getDirectories ./../hosts; 125 + hostsInformations = lib.concatMap getSystemHostsInformations systems; 126 + in { 127 + 128 + }; 129 + }; 130 + 131 + ## Flake output 132 + ## Help manage flake output creation 133 + flake = rec { 134 + ## Build flake output 135 + mkFlake = {}; 136 + }; 137 + }
modules/bsd/.gitkeep

This is a binary file and will not be displayed.