Nix Flakes configuration for MacOS, NixOS and WSL
0
fork

Configure Feed

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

refactor/dentritic-pattern (#1)

Co-authored-by: cosmeak <90453342+Cosmeak@users.noreply.github.com>
Reviewed-on: https://codeberg.org/cosmeak/asgard/pulls/1

cosmeak c63767c0 3845d216

+575 -926
+10 -31
README.md
··· 2 2 <h1> asgard </h1> 3 3 </div> 4 4 5 - This configuration is under constant construction so some things may be remove or add accordings to my needs but i want to keep all even if it's not used anymore. 6 - 7 5 > [!IMPORTANT] 6 + > This configuration is under constant construction so some things may be remove or add accordings to my needs but i want to keep all even if it's not used anymore. 7 + > 8 8 > Since this configuration is made for my own needs, you can take inspiration and some configuration but do not expect it to work on your side. 9 9 > 10 10 > Any damage caused by this configuration is not my responsibility, so use it at your own risks. ··· 25 25 26 26 - [x] NixOS 27 27 - [x] Nix Darwin 28 - - [x] WSL 29 - - [ ] Nix BSD 28 + - [ ] WSL (because not used anymore) 29 + - [ ] Nix BSD (in wait of a stable state to be used anywhere else than a vm) 30 30 - [ ] MicroVM for servers 31 31 - [ ] Secrets management 32 32 - [ ] Secure Boot ··· 39 39 40 40 ## Installation 41 41 42 - ``` 43 - TODO 44 - ``` 42 + > TODO: write the documentation to install easely a new host with a few steps 45 43 46 44 ## Machines 47 45 ··· 51 49 | `loki` | ASUS ROG STRIX B760-I GAMING WIFI | Intel i5 13600kf | Nvidia 4070ti | 32Go | ❄️ | 🎮️ | 🟢️ | 52 50 | `lithium` | Raspberry Pi3 b+ | - | - | 1Go | ❄️ | 🧨️ | 🔴 | 53 51 | `vali` | WSL | - | - | 8Go | ❄️ | 💾️ | 🔴 | 54 - | `andhrimnir` | Aorus B450 Elite | AMD Ryzen 3 3300X | Nvidia 1060 | 16Go | ❄️ | 🎮️ / ⌨️ | 🟠 | 55 - | `elli` | HP ProDesk 400 G1 DM | Intel Pentium G3250T | - | 8Go | ❄️ | 💾️ | 🔴 | 56 - | `sunna` | ASUS ROG STRIX G15 | Intel i7 10870H | Nvidia 2060 | 16Go | ❄️ | 🖥️ | 🟠 | 52 + | `andhrimnir` | Aorus B450 Elite | AMD Ryzen 3 3300X | Nvidia 1060 | 16Go | ❄️ | 🎮️ / ⌨️ | 🟢️ | 53 + | `elli` | HP ProDesk 400 G1 DM | Intel Pentium G3250T | - | 8Go | ❄️ | 💾️ | 🟠 | 54 + | `sunna` | ASUS ROG STRIX G15 | Intel i7 10870H | Nvidia 2060 | 16Go | ❄️ | 🖥️ | 🔴 | 57 55 58 56 <details> 59 57 <summary>Legend</summary> ··· 72 70 73 71 ## Folder structure 74 72 75 - ``` 76 - . 77 - ├── lib # Asgard custom libary to help configure machines and users 78 - ├── machines # Machine configurations 79 - │ └── <os> 80 - │ │ └── <hostname> 81 - ├── modules # Asgard custom modules by os 82 - │ ├── common 83 - │ ├── darwin 84 - │ └── nixos 85 - ├── packages # Packages not present in nixpkgs 86 - ├── overlays # Package override 87 - ├── templates # Template for boostrapping projects (zig, go, ...) 88 - ├── users # Home configuration by users and hosts 89 - │ ├── common 90 - │ └── <username> 91 - │ │ └── <hostname> 92 - ├── flake.nix # Configuration entrypoint 93 - ├── flake.lock # Pinned versions of packages repositories 94 - └── justfile # Command helper (like a Makefile) 95 - ``` 73 + > TODO: write the new documentation with the dentritic pattern usage 96 74 97 75 ## Commands 98 76 ··· 117 95 - [Flakes book](https://nixos-and-flakes.thiscute.world/) 118 96 - [Nix Language](https://nix.dev/) 119 97 - [Nix Tour](https://nixcloud.io/tour/?id=introduction/nix) 98 + - [Dentritic Pattern explanation](https://github.com/Doc-Steve/dendritic-design-with-flake-parts) 120 99 121 100 ## Troubleshooting 122 101
+144 -6
flake.lock
··· 7 7 ] 8 8 }, 9 9 "locked": { 10 - "lastModified": 1765066094, 11 - "narHash": "sha256-0YSU35gfRFJzx/lTGgOt6ubP8K6LeW0vaywzNNqxkl4=", 10 + "lastModified": 1767634391, 11 + "narHash": "sha256-owcSz2ICqTSvhBbhPP+1eWzi88e54rRZtfCNE5E/wwg=", 12 12 "owner": "nix-darwin", 13 13 "repo": "nix-darwin", 14 - "rev": "688427b1aab9afb478ca07989dc754fa543e03d5", 14 + "rev": "08585aacc3d6d6c280a02da195fdbd4b9cf083c2", 15 15 "type": "github" 16 16 }, 17 17 "original": { ··· 21 21 "type": "github" 22 22 } 23 23 }, 24 + "flake-parts": { 25 + "inputs": { 26 + "nixpkgs-lib": "nixpkgs-lib" 27 + }, 28 + "locked": { 29 + "lastModified": 1767609335, 30 + "narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=", 31 + "owner": "hercules-ci", 32 + "repo": "flake-parts", 33 + "rev": "250481aafeb741edfe23d29195671c19b36b6dca", 34 + "type": "github" 35 + }, 36 + "original": { 37 + "owner": "hercules-ci", 38 + "repo": "flake-parts", 39 + "type": "github" 40 + } 41 + }, 42 + "hjem": { 43 + "inputs": { 44 + "nix-darwin": "nix-darwin", 45 + "nixpkgs": [ 46 + "nixpkgs" 47 + ], 48 + "smfh": "smfh" 49 + }, 50 + "locked": { 51 + "lastModified": 1767318528, 52 + "narHash": "sha256-I2zxtEafZbFbqXe71rjqwVeTDv8SIVLaSzQd39SwfwM=", 53 + "owner": "feel-co", 54 + "repo": "hjem", 55 + "rev": "8539013044624a257e8da370069107aea148e985", 56 + "type": "github" 57 + }, 58 + "original": { 59 + "owner": "feel-co", 60 + "repo": "hjem", 61 + "type": "github" 62 + } 63 + }, 64 + "nix-darwin": { 65 + "inputs": { 66 + "nixpkgs": [ 67 + "hjem", 68 + "nixpkgs" 69 + ] 70 + }, 71 + "locked": { 72 + "lastModified": 1765065051, 73 + "narHash": "sha256-b7W9WsvyMOkUScNxbzS45KEJp0iiqRPyJ1I3JBE+oEE=", 74 + "owner": "nix-darwin", 75 + "repo": "nix-darwin", 76 + "rev": "7e22bf538aa3e0937effcb1cee73d5f1bcc26f79", 77 + "type": "github" 78 + }, 79 + "original": { 80 + "owner": "nix-darwin", 81 + "repo": "nix-darwin", 82 + "type": "github" 83 + } 84 + }, 24 85 "nixpkgs": { 25 86 "locked": { 26 - "lastModified": 1766201043, 27 - "narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=", 87 + "lastModified": 1767480499, 88 + "narHash": "sha256-8IQQUorUGiSmFaPnLSo2+T+rjHtiNWc+OAzeHck7N48=", 28 89 "owner": "nixos", 29 90 "repo": "nixpkgs", 30 - "rev": "b3aad468604d3e488d627c0b43984eb60e75e782", 91 + "rev": "30a3c519afcf3f99e2c6df3b359aec5692054d92", 31 92 "type": "github" 32 93 }, 33 94 "original": { ··· 37 98 "type": "github" 38 99 } 39 100 }, 101 + "nixpkgs-lib": { 102 + "locked": { 103 + "lastModified": 1765674936, 104 + "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", 105 + "owner": "nix-community", 106 + "repo": "nixpkgs.lib", 107 + "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", 108 + "type": "github" 109 + }, 110 + "original": { 111 + "owner": "nix-community", 112 + "repo": "nixpkgs.lib", 113 + "type": "github" 114 + } 115 + }, 40 116 "root": { 41 117 "inputs": { 42 118 "darwin": "darwin", 119 + "flake-parts": "flake-parts", 120 + "hjem": "hjem", 43 121 "nixpkgs": "nixpkgs" 122 + } 123 + }, 124 + "rust-overlay": { 125 + "inputs": { 126 + "nixpkgs": [ 127 + "hjem", 128 + "smfh", 129 + "nixpkgs" 130 + ] 131 + }, 132 + "locked": { 133 + "lastModified": 1763347184, 134 + "narHash": "sha256-6QH8hpCYJxifvyHEYg+Da0BotUn03BwLIvYo3JAxuqQ=", 135 + "owner": "oxalica", 136 + "repo": "rust-overlay", 137 + "rev": "08895cce80433978d5bfd668efa41c5e24578cbd", 138 + "type": "github" 139 + }, 140 + "original": { 141 + "owner": "oxalica", 142 + "repo": "rust-overlay", 143 + "type": "github" 144 + } 145 + }, 146 + "smfh": { 147 + "inputs": { 148 + "nixpkgs": [ 149 + "hjem", 150 + "nixpkgs" 151 + ], 152 + "rust-overlay": "rust-overlay", 153 + "systems": "systems" 154 + }, 155 + "locked": { 156 + "lastModified": 1763430012, 157 + "narHash": "sha256-06G7pXUdpMnUqR0JWWvV7sA8oNGOZU1cSLqQS1GMf7Y=", 158 + "owner": "feel-co", 159 + "repo": "smfh", 160 + "rev": "eddda76e3dd4c6deaea5f819f174fc16dbe70f90", 161 + "type": "github" 162 + }, 163 + "original": { 164 + "owner": "feel-co", 165 + "repo": "smfh", 166 + "type": "github" 167 + } 168 + }, 169 + "systems": { 170 + "locked": { 171 + "lastModified": 1681028828, 172 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 173 + "owner": "nix-systems", 174 + "repo": "default", 175 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 176 + "type": "github" 177 + }, 178 + "original": { 179 + "owner": "nix-systems", 180 + "repo": "default", 181 + "type": "github" 44 182 } 45 183 } 46 184 },
+16 -69
flake.nix
··· 1 1 { 2 - description = '' 3 - This configuration is the second version of all my systems, reworked from scratch with simplicity in mind. 4 - 5 - I take my inspiration from others people configurations, so if you want to know what inspired this, take a look a "Nix things" and "Useful dotfiles" in my stars list. 6 - ''; 7 - 8 2 inputs = { 9 - # packages 10 - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11"; 11 - nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable"; 3 + # Packages 4 + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; 12 5 13 6 # Macos modules 14 - darwin = { 15 - url = "github:nix-darwin/nix-darwin?ref=nix-darwin-25.11"; 16 - inputs.nixpkgs.follows= "nixpkgs"; 17 - }; 7 + darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.11"; 8 + darwin.inputs.nixpkgs.follows= "nixpkgs"; 9 + 10 + # Flake helper 11 + flake-parts.url = "github:hercules-ci/flake-parts"; 18 12 19 - # File wrapper for config files 13 + # Home/User configuration helper 20 14 hjem.url = "github:feel-co/hjem"; 15 + hjem.inputs.nixpkgs.follows= "nixpkgs"; 21 16 }; 22 17 23 - # Force some nix configurations globally 24 - nixConfig = { 25 - experimental-features = "nix-command flakes pipe-operators"; 26 - }; 27 - 28 - outputs = { self, nixpkgs, ... }@inputs : 29 - let 30 - lib = import ./lib { inherit self inputs; }; 31 - 32 - # Modules 33 - common = lib.fs.getFilesRecursively ./modules/common; 34 - nixosModules = lib.fs.getFilesRecursively ./modules/nixos ++ common; 35 - darwinModules = lib.fs.getFilesRecursively ./modules/darwin ++ common; 36 - in { 37 - nixosConfigurations = { 38 - # Gaming config (console like) 39 - loki = nixpkgs.lib.nixosSystem { 40 - system = "x86_64-linux"; 41 - specialArgs = { 42 - inherit inputs; 43 - hostname = "loki"; 44 - }; 45 - modules = [ ./machines/nixos/loki ] ++ nixosModules; 46 - }; 47 - 48 - # Asus Rog G15 (work/gaming) 49 - sunna = nixpkgs.lib.nixosSystem { 50 - system = "x86_64-linux"; 51 - specialArgs = { 52 - inherit inputs; 53 - hostname = "sunna"; 54 - }; 55 - modules = [ ./machines/nixos/sunna ] ++ nixosModules; 56 - }; 57 - 58 - # Neoxa gaming config 59 - andhrimnir = nixpkgs.lib.nixosSystem { 60 - system = "x86_64-linux"; 61 - specialArgs = { 62 - inherit inputs; 63 - hostname = "andhrimnir"; 64 - }; 65 - modules = [ ./machines/nixos/andhrimnir ] ++ nixosModules; 66 - }; 18 + outputs = inputs@{ flake-parts, ... }: 19 + flake-parts.lib.mkFlake { inherit inputs; } { 20 + imports = [ 21 + flake-parts.flakeModules.modules 22 + ./modules 23 + ]; 24 + systems = [ "x86_64-linux" "aarch64-darwin" ]; 67 25 }; 68 - 69 - # Macbook Pro M2 70 - darwinConfigurations.njord = inputs.darwin.lib.darwinSystem { 71 - system = "aarch64-darwin"; 72 - specialArgs = { 73 - inherit inputs; 74 - hostname = "njord"; 75 - }; 76 - modules = [ ./machines/darwin/njord ] ++ darwinModules; 77 - }; 78 - }; 79 26 }
+2 -2
justfile
··· 10 10 if [[ "$OSTYPE" == "darwin"* ]]; then \ 11 11 sudo darwin-rebuild switch --flake .#{{ hostname }}; \ 12 12 else \ 13 - sudo nixos-rebuild switch --flake .#{{ hostname }}; \ 13 + sudo nixos-rebuild switch --flake .#{{ hostname }} --impure; \ 14 14 fi; 15 15 16 16 # Build a new configuration ··· 19 19 if [[ "$OSTYPE" == "darwin"* ]]; then \ 20 20 @echo "This is not possible to do it on MacOS." 21 21 else \ 22 - sudo nixos-rebuild switch --flake .#{{ hostname }}; \ 22 + sudo nixos-rebuild boot --flake .#{{ hostname }} --impure; \ 23 23 fi; 24 24 25 25 # Format code
-6
lib/default.nix
··· 1 - ## Custom library built on top of nix lib 2 - { self, inputs, ... }: 3 - { 4 - forAllSystems = inputs.nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; 5 - fs = import ./fs.nix { inherit self inputs; }; 6 - }
-30
lib/fs.nix
··· 1 - ## FileSystem 2 - ## Help manage file and access to it 3 - { self, inputs, ... }: 4 - 5 - let inherit (inputs.nixpkgs) lib; in 6 - 7 - rec { 8 - ## Match if type is a directory 9 - #@ String -> Boolean 10 - isDirectory = type: type == "directory"; 11 - 12 - ## Match if type is a file 13 - #@ String -> Boolean 14 - isFile = type: type == "regular"; 15 - 16 - ## Get files in all folders at a giver path 17 - #@ Path -> []Path 18 - getFilesRecursively = path: let 19 - entries = builtins.readDir path |> lib.filterAttrs (name: type: (type |> isDirectory) || (type |> isFile)); 20 - mapFile = name: type: let 21 - path' = "${path}/${name}"; 22 - in 23 - if type |> isDirectory 24 - then getFilesRecursively path' 25 - else if name |> lib.hasSuffix ".nix" 26 - then path' 27 - else []; 28 - files = lib.flatten (lib.mapAttrsToList mapFile entries); 29 - in files; 30 - }
-75
machines/darwin/njord/default.nix
··· 1 - { lib, pkgs, hostname, ... }: 2 - { 3 - imports = [ 4 - ./homebrew 5 - ./system 6 - ]; 7 - 8 - 9 - # workaround to the problem of application not being shown by spotlight 10 - system.activationScripts.applications.text = lib.mkForce ""; 11 - 12 - # Enable sudo via TouchID 13 - security.pam.services.sudo_local.touchIdAuth = true; 14 - 15 - # Networking 16 - networking.computerName = hostname; 17 - networking.hostName = hostname; 18 - 19 - # Timezone 20 - time.timeZone = "Europe/Paris"; 21 - 22 - # System wide programs 23 - programs._1password-gui.enable = true; # Password manager 24 - 25 - # Users 26 - environment.systemPackages= with pkgs; [ 27 - # alt-tab-macos # alt tab like windows on macos 28 - bruno # ide for testing apis 29 - dbeaver-bin # database client 30 - git # versionning tool 31 - helix # modal code editor 32 - just 33 - lazygit # git tui helper 34 - # librewolf # web browser 35 - # obsidian # note taking 36 - stats # System monitoring displayed in macos top bar - will be replaced by custom script with sketchybar 37 - # spotify # music player 38 - podman # container tool -> replacement of docker 39 - podman-compose # compose provider for podman 40 - # raycast # replacement for spotlight 41 - # zed-editor # gui code editor 42 - ]; 43 - 44 - # Add environment variables to the system 45 - environment.variables = { 46 - EDITOR = "zeditor"; 47 - }; 48 - 49 - # Linux builder 50 - nix = { 51 - linux-builder.enable = true; 52 - 53 - # This line is a prerequisite 54 - settings.trusted-users = [ "@admin" ]; 55 - }; 56 - 57 - # Common system configurations 58 - asgard.system.garbageCollector.enable = true; 59 - 60 - # The platform the configuration will be used on. 61 - nixpkgs.hostPlatform = "aarch64-darwin"; 62 - 63 - # Allow packages 64 - nixpkgs.config.allowUnfree = true; 65 - 66 - # Use nix as a daemon 67 - nix.enable = true; 68 - 69 - # Enable flakes and other experimental features 70 - nix.settings.experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; 71 - 72 - # Used for backwards compatibility, please read the changelog before changing. 73 - # $ darwin-rebuild changelog 74 - system.stateVersion = 5; 75 - }
-5
machines/darwin/njord/homebrew/brews.nix
··· 1 - { 2 - homebrew.brews = [ 3 - # "wallpapper" # to package 4 - ]; 5 - }
-20
machines/darwin/njord/homebrew/casks.nix
··· 1 - { 2 - # If something is here, it's either not available in nixpkgs or broken 3 - homebrew.casks = [ 4 - "alt-tab" 5 - "amethyst" # Window manager (to package for nix) 6 - # "logitech-g-hub" #! Error when trying to install it 7 - "balenaetcher" # image flasher 8 - "cursor" # AI code editor - used for testing 9 - "desmume" # Nintendo DS emulator 10 - "discord" 11 - "figma" # ux/ui 12 - "ghostty" 13 - "librewolf" 14 - "obsidian" 15 - "raycast" 16 - "spotify" 17 - "steam" 18 - "zed" 19 - ]; 20 - }
-25
machines/darwin/njord/homebrew/default.nix
··· 1 - { 2 - # Homebrew - Using for gui app because majority macos apps does not exists in nixpkgs repository 3 - imports = [ 4 - ./brews.nix 5 - ./casks.nix 6 - ]; 7 - 8 - homebrew.enable = true; 9 - homebrew.onActivation = { 10 - autoUpdate = true; 11 - cleanup = "zap"; # uninstall all elements not listed 12 - }; 13 - 14 - homebrew.caskArgs.no_quarantine = true; # used for some "break" packages like librewolf 15 - 16 - # Repository authorized for homebrew 17 - homebrew.taps = [ 18 - "mczachurski/wallpapper" 19 - ]; 20 - 21 - # Apps from App Store - Just used for XCode because not avalaible somewhere else 22 - homebrew.masApps = { 23 - Xcode = 497799835; 24 - }; 25 - }
-19
machines/darwin/njord/system/default.nix
··· 1 - { 2 - imports = [ 3 - ./dock.nix 4 - ./finder.nix 5 - ./nsglobaldomain.nix 6 - ]; 7 - 8 - system.primaryUser = "cosmeak"; 9 - 10 - # Disable startup sound 11 - system.nvram.variables = { 12 - "StartupMute" = "%01"; 13 - }; 14 - 15 - system.defaults = { 16 - # Deactivate state manager 17 - WindowManager.GloballyEnabled = false; 18 - }; 19 - }
-22
machines/darwin/njord/system/dock.nix
··· 1 - { 2 - system.defaults.dock = { 3 - autohide = true; 4 - orientation = "bottom"; # Set dock to bottom 5 - mru-spaces = false; # Auto arrange space based on the most recent use 6 - launchanim = false; # Remove animation when opening an app 7 - mineffect = "scale"; # Change animation from minimize/maximize app 8 - magnification = false; 9 - minimize-to-application = true; # Minimize app in app icon 10 - show-recents = false; # Don't show recent open apps 11 - tilesize = 32; # Set dock size 12 - 13 - # Set dock apps (remove all apps from dock) 14 - persistent-apps = [ "/System/Applications/Launchpad.app" ]; 15 - 16 - # Disable hot corners 17 - wvous-bl-corner = 1; 18 - wvous-br-corner = 1; 19 - wvous-tl-corner = 1; 20 - wvous-tr-corner = 1; 21 - }; 22 - }
-10
machines/darwin/njord/system/finder.nix
··· 1 - { 2 - system.defaults.screencapture.location = "~/Pictures/screenshots"; 3 - system.defaults.finder = { 4 - AppleShowAllExtensions = true; # Show file extension 5 - AppleShowAllFiles = true; # Show hidden files 6 - FXPreferredViewStyle = "clmv"; # Set default view to column 7 - CreateDesktop = false; # Disable show icon on desktop 8 - FXDefaultSearchScope = "SCcf"; # Set default search scope to current folder 9 - }; 10 - }
-22
machines/darwin/njord/system/nsglobaldomain.nix
··· 1 - { 2 - system.defaults.NSGlobalDomain = { 3 - # Switch between dark and light mode automatically 4 - AppleInterfaceStyleSwitchesAutomatically = true; 5 - # Disable saving new documents to icloud 6 - NSDocumentSaveNewDocumentsToCloud = false; 7 - # Time before the key is repeated 8 - # InitialKeyRepeat = 7; 9 - # Time between repeat key 10 - # KeyRepeat = 6; 11 - # Window open animation 12 - NSAutomaticWindowAnimationsEnabled = false; 13 - # Icon size in finder 14 - NSTableViewDefaultSizeMode = 2; 15 - # Drag from anywhere a window to move it 16 - NSWindowShouldDragOnGesture = true; 17 - # Deativate sound bip when volume is changed 18 - "com.apple.sound.beep.feedback" = 0; 19 - # Natural scrolling direction 20 - "com.apple.swipescrolldirection" = true; 21 - }; 22 - }
-92
machines/nixos/andhrimnir/default.nix
··· 1 - { self, pkgs, hostname, ... }: 2 - { 3 - imports = [ 4 - ./hardware.nix 5 - ]; 6 - 7 - # Bootloader 8 - boot.loader.grub.enable = true; 9 - boot.loader.grub.device = "nodev"; 10 - boot.loader.grub.useOSProber = true; 11 - boot.loader.grub.efiSupport = true; 12 - boot.loader.efi.canTouchEfiVariables = true; 13 - 14 - # Locales 15 - i18n.defaultLocale = "fr_FR.UTF-8"; 16 - 17 - # Timezone 18 - time.timeZone = "Europe/Paris"; 19 - 20 - # Keyboard 21 - services.xserver.xkb.layout = "fr"; 22 - 23 - # Networking 24 - networking.networkmanager.enable = true; 25 - networking.hostName = hostname; 26 - 27 - # Audio 28 - asgard.hardware.audio.enable = true; 29 - 30 - # Nvidia GPU and OpenGL 31 - hardware.graphics = { 32 - enable = true; 33 - enable32Bit = true; 34 - }; 35 - services.xserver.videoDrivers = [ "nvidia" ]; 36 - hardware.nvidia = { 37 - package = config.boot.kernelPackages.nvidiaPackages.latest; 38 - modesetting.enable = true; 39 - powerManagement.enable = false; 40 - powerManagement.finegrained = false; 41 - open = false; 42 - nvidiaSettings = true; 43 - }; 44 - 45 - # Disable CUPS since this desktop will not print something. 46 - services.printing.enable = false; 47 - 48 - # Common system configurations 49 - asgard.system.garbageCollector.enable= true; 50 - 51 - # Enable unfree packages 52 - nixpkgs.config.allowUnfree = true; 53 - 54 - # Packages 55 - programs.steam.enable = true; 56 - programs.starship.enable = true; 57 - environment.systemPackages = with pkgs; [ 58 - git 59 - ]; 60 - 61 - users.users."neoxa" = { 62 - isNormalUser = true; 63 - extraGroups = [ "wheel" ]; 64 - 65 - # User wide packages 66 - packages = with pkgs; [ 67 - heroic 68 - librewolf 69 - lutris 70 - spotify 71 - vesktop 72 - vscodium 73 - ]; 74 - }; 75 - 76 - # Automatic login 77 - services.displayManager.autoLogin.enable = true; 78 - services.displayManager.autoLogin.user = "benjamin"; 79 - 80 - # Desktop 81 - services.displayManager.sddm.enable = true; 82 - services.displayManager.sddm.wayland.enable = true; 83 - services.desktopManager.plasma6.enable = true; 84 - 85 - # This value determines the NixOS release from which the default 86 - # settings for stateful data, like file locations and database versions 87 - # on your system were taken. It‘s perfectly fine and recommended to leave 88 - # this value at the release version of the first install of this system. 89 - # Before changing this value read the documentation for this option 90 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 91 - system.stateVersion = "25.05"; # Did you read the comment? 92 - }
-38
machines/nixos/andhrimnir/hardware.nix
··· 1 - # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 - # and may be overwritten by future invocations. Please make changes 3 - # to /etc/nixos/configuration.nix instead. 4 - { config, lib, pkgs, modulesPath, ... }: 5 - 6 - { 7 - imports = 8 - [ (modulesPath + "/installer/scan/not-detected.nix") 9 - ]; 10 - 11 - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; 12 - boot.initrd.kernelModules = [ ]; 13 - boot.kernelModules = [ "kvm-amd" ]; 14 - boot.extraModulePackages = [ ]; 15 - 16 - fileSystems."/" = 17 - { device = "/dev/disk/by-uuid/fd217360-823a-44b2-a85c-9eb968aa8a51"; 18 - fsType = "ext4"; 19 - }; 20 - 21 - fileSystems."/boot" = 22 - { device = "/dev/disk/by-uuid/20F1-277B"; 23 - fsType = "vfat"; 24 - options = [ "fmask=0077" "dmask=0077" ]; 25 - }; 26 - 27 - swapDevices = [ ]; 28 - 29 - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 30 - # (the default) this is the recommended approach. When using systemd-networkd it's 31 - # still possible to use this option, but it's recommended to use it in conjunction 32 - # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 33 - networking.useDHCP = lib.mkDefault true; 34 - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; 35 - 36 - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 37 - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 38 - }
-48
machines/nixos/elli/default.nix
··· 1 - { self, inputs, pkgs, hostname, ... }: 2 - { 3 - # imports = [ ./hardware.nix ]; 4 - 5 - # EFI Bootloader 6 - boot.loader.systemd-boot.enable = true; 7 - boot.loader.efi.canTouchEfiVariables = true; 8 - boot.loader.systemd-boot.configurationLimit = 10; 9 - 10 - # Locales 11 - i18n.defaultLocale = "en_US.UTF-8"; 12 - i18n.extraLocaleSettings = { 13 - LC_ADDRESS = "fr_FR.UTF-8"; 14 - LC_IDENTIFICATION = "fr_FR.UTF-8"; 15 - LC_MEASUREMENT = "fr_FR.UTF-8"; 16 - LC_MONETARY = "fr_FR.UTF-8"; 17 - LC_NAME = "fr_FR.UTF-8"; 18 - LC_NUMERIC = "fr_FR.UTF-8"; 19 - LC_PAPER = "fr_FR.UTF-8"; 20 - LC_TELEPHONE = "fr_FR.UTF-8"; 21 - LC_TIME = "fr_FR.UTF-8"; 22 - }; 23 - 24 - # Timezone 25 - time.timeZone = "Europe/Paris"; 26 - 27 - # Keyboard 28 - services.xserver.xkb.layout = "us"; 29 - 30 - # Networking 31 - networking.networkmanager.enable = true; 32 - networking.hostName = hostname; 33 - 34 - # Disable CUPS since this desktop will not print something. 35 - services.printing.enable = false; 36 - 37 - # Common system configurations 38 - asgard.system.garbageCollector.enable= true; 39 - asgard.system.autoUpdate.enable = false; 40 - 41 - # This value determines the NixOS release from which the default 42 - # settings for stateful data, like file locations and database versions 43 - # on your system were taken. It‘s perfectly fine and recommended to leave 44 - # this value at the release version of the first install of this system. 45 - # Before changing this value read the documentation for this option 46 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 47 - system.stateVersion = "24.11"; # Did you read the comment? 48 - }
-18
machines/nixos/hoenir/default.nix
··· 1 - { config, pkgs, inputs, lib, hostname,... }: 2 - { 3 - imports = [ ]; 4 - 5 - # Network 6 - networking.hostName = hostname; 7 - 8 - # Enable ssh 9 - services.openssh.enable = true; 10 - 11 - # This value determines the NixOS release from which the default 12 - # settings for stateful data, like file locations and database versions 13 - # on your system were taken. It‘s perfectly fine and recommended to leave 14 - # this value at the release version of the first install of this system. 15 - # Before changing this value read the documentation for this option 16 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 17 - system.stateVersion = "24.11"; # Did you read the comment? 18 - }
-120
machines/nixos/loki/default.nix
··· 1 - { config, pkgs, hostname, ... }: 2 - { 3 - imports = [ 4 - ./hardware.nix 5 - ]; 6 - 7 - # EFI Bootloader 8 - boot.loader.systemd-boot.enable = true; 9 - boot.loader.efi.canTouchEfiVariables = true; 10 - boot.loader.systemd-boot.configurationLimit = 10; 11 - 12 - # Locales 13 - i18n.defaultLocale = "en_US.UTF-8"; 14 - i18n.extraLocaleSettings = { 15 - LC_ADDRESS = "fr_FR.UTF-8"; 16 - LC_IDENTIFICATION = "fr_FR.UTF-8"; 17 - LC_MEASUREMENT = "fr_FR.UTF-8"; 18 - LC_MONETARY = "fr_FR.UTF-8"; 19 - LC_NAME = "fr_FR.UTF-8"; 20 - LC_NUMERIC = "fr_FR.UTF-8"; 21 - LC_PAPER = "fr_FR.UTF-8"; 22 - LC_TELEPHONE = "fr_FR.UTF-8"; 23 - LC_TIME = "fr_FR.UTF-8"; 24 - }; 25 - 26 - # Timezone 27 - time.timeZone = "Europe/Paris"; 28 - 29 - # Keyboard 30 - services.xserver.xkb.layout = "us"; 31 - 32 - # Audio 33 - asgard.hardware.audio.enable = true; 34 - 35 - # Nvidia GPU and OpenGL 36 - hardware.graphics = { 37 - enable = true; 38 - enable32Bit = true; 39 - }; 40 - services.xserver.videoDrivers = [ "nvidia" ]; 41 - hardware.nvidia = { 42 - package = config.boot.kernelPackages.nvidiaPackages.latest; 43 - modesetting.enable = true; 44 - powerManagement.enable = false; 45 - powerManagement.finegrained = false; 46 - open = false; 47 - nvidiaSettings = true; 48 - }; 49 - 50 - # Networking 51 - networking.networkmanager.enable = true; 52 - networking.hostName = hostname; 53 - 54 - # Desktop Environment 55 - services.displayManager.gdm.enable = true; 56 - services.displayManager.autoLogin.enable = true; 57 - services.displayManager.autoLogin.user = "cosmeak"; 58 - services.desktopManager.gnome.enable = true; 59 - services.gnome.games.enable = false; 60 - services.gnome.core-developer-tools.enable = false; 61 - environment.gnome.excludePackages = with pkgs; [ 62 - gnome-tour 63 - gnome-user-docs 64 - gnome-text-editor 65 - gnome-console 66 - ]; 67 - 68 - # Global packages 69 - environment.systemPackages = with pkgs; [ 70 - git 71 - just 72 - nixd 73 - ]; 74 - 75 - # Users 76 - users.users."cosmeak" = { 77 - isNormalUser = true; 78 - description = "cosmeak"; 79 - extraGroups = [ "networkmanager" "wheel" ]; 80 - packages = with pkgs; [ 81 - _1password-gui # Password manager 82 - code-cursor # AI Code Editor 83 - ghostty # Terminal Emulator 84 - heroic # Game Launcher (Epic Games, GOG) 85 - librewolf # Web Browser 86 - obs-studio # Recording App 87 - obsidian # Note taking 88 - prismlauncher # Minecraft launcher 89 - spotify # Music Player 90 - vesktop # Discord custom client 91 - zed-editor # Code Editor 92 - ]; 93 - }; 94 - 95 - # Steam 96 - programs.steam = { 97 - enable = true; 98 - gamescopeSession.enable = true; 99 - }; 100 - 101 - # Disable CUPS since this desktop will not print something. 102 - services.printing.enable = false; 103 - 104 - # Common system configurations 105 - asgard.system.garbageCollector.enable = true; 106 - 107 - # Enable unfree packages 108 - nixpkgs.config.allowUnfree = true; 109 - 110 - # Enable flakes and other experimental features 111 - nix.settings.experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; 112 - 113 - # This value determines the NixOS release from which the default 114 - # settings for stateful data, like file locations and database versions 115 - # on your system were taken. It‘s perfectly fine and recommended to leave 116 - # this value at the release version of the first install of this system. 117 - # Before changing this value read the documentation for this option 118 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 119 - system.stateVersion = "24.11"; # Did you read the comment? 120 - }
-38
machines/nixos/loki/hardware.nix
··· 1 - # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 - # and may be overwritten by future invocations. Please make changes 3 - # to /etc/nixos/configuration.nix instead. 4 - { config, lib, modulesPath, ... }: 5 - { 6 - imports = 7 - [ (modulesPath + "/installer/scan/not-detected.nix") 8 - ]; 9 - 10 - boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; 11 - boot.initrd.kernelModules = [ ]; 12 - boot.kernelModules = [ "kvm-intel" ]; 13 - boot.extraModulePackages = [ ]; 14 - 15 - fileSystems."/" = 16 - { device = "/dev/disk/by-uuid/1cbaa92a-7c91-496f-b1b4-32a1249ba9af"; 17 - fsType = "ext4"; 18 - }; 19 - 20 - fileSystems."/boot" = 21 - { device = "/dev/disk/by-uuid/7EAC-2F74"; 22 - fsType = "vfat"; 23 - options = [ "fmask=0077" "dmask=0077" ]; 24 - }; 25 - 26 - swapDevices = [ ]; 27 - 28 - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 29 - # (the default) this is the recommended approach. When using systemd-networkd it's 30 - # still possible to use this option, but it's recommended to use it in conjunction 31 - # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 32 - networking.useDHCP = lib.mkDefault true; 33 - # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; 34 - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; 35 - 36 - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 37 - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 38 - }
-105
machines/nixos/sunna/default.nix
··· 1 - { self, inputs, pkgs, hostname, ... }: 2 - { 3 - imports = [ ./hardware-configuration.nix ]; 4 - 5 - # Networking 6 - networking.hostName = hostname; 7 - 8 - # GRUB Bootloader 9 - boot.loader.systemd-boot.enable = true; 10 - # boot.loader.grub.enable = true; 11 - # boot.loader.grub.device = "nodev"; 12 - # boot.loader.grub.useOSProber = true; 13 - boot.loader.efi.canTouchEfiVariables = true; 14 - 15 - # Desktop Environment 16 - services.xserver.enable = true; 17 - services.xserver.displayManager.lightdm.enable = true; 18 - services.xserver.desktopManager.budgie.enable = true; 19 - 20 - 21 - # Global packages 22 - programs.firefox.enable = true; 23 - environment.systemPackages = with pkgs; [ 24 - wget 25 - git 26 - curl 27 - vscodium 28 - just 29 - ]; 30 - 31 - # Audio 32 - asgard.hardware.audio.enable = true; 33 - 34 - # RGB Controller 35 - services.hardware.openrgb.enable = true; 36 - 37 - # Lang 38 - i18n.defaultLocale = "fr_FR.UTF-8"; 39 - services.xserver.xkb.layout = "fr"; 40 - 41 - # Gaming settings 42 - programs.steam.enable = true; 43 - programs.steam.gamescopeSession.enable = true; 44 - programs.steam.gamescopeSession.env = { 45 - __NV_PRIME_RENDER_OFFLOAD = "1"; 46 - __GLX_VENDOR_LIBRARY_NAME = "nvidia"; 47 - __VK_LAYER_NV_optimus = "NVIDIA_ONLY"; 48 - }; 49 - 50 - # Nvidia 51 - hardware.graphics = { 52 - enable = true; 53 - enable32Bit = true; 54 - }; 55 - hardware.nvidia = { 56 - # package = config.boot.kernelPackages.nvidiaPackages.latest; 57 - modesetting.enable = true; 58 - powerManagement.enable = true; 59 - powerManagement.finegrained = true; 60 - open = false; 61 - nvidiaSettings = true; 62 - }; 63 - 64 - # Users 65 - users.users = { 66 - "neoxa" = { 67 - isNormalUser = true; 68 - extraGroups = [ "networkmanager" "wheel" ]; 69 - packages = with pkgs; [ 70 - spotify 71 - vesktop 72 - heroic 73 - 74 - # Needed for school 75 - blender 76 - unityhub 77 - obs-studio 78 - 79 - # Coding environment for school 80 - php 81 - php84Packages.composer 82 - nodejs_22 83 - python313 84 - ]; 85 - }; 86 - }; 87 - 88 - # Nix settings 89 - asgard.system.garbageCollector.enable = true; 90 - nixpkgs.config.allowUnfree = true; 91 - 92 - # Enable flakes and other experimental features 93 - nix.settings.experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; 94 - 95 - # Change buffer download size to 500Mo 96 - nix.settings.download-buffer-size = 524288000; 97 - 98 - # This value determines the NixOS release from which the default 99 - # settings for stateful data, like file locations and database versions 100 - # on your system were taken. It‘s perfectly fine and recommended to leave 101 - # this value at the release version of the first install of this system. 102 - # Before changing this value read the documentation for this option 103 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 104 - system.stateVersion = "25.05"; # Did you read the comment? 105 - }
-49
machines/nixos/sunna/hardware-configuration.nix
··· 1 - # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 - # and may be overwritten by future invocations. Please make changes 3 - # to /etc/nixos/configuration.nix instead. 4 - { config, lib, pkgs, modulesPath, ... }: 5 - 6 - { 7 - imports = 8 - [ (modulesPath + "/installer/scan/not-detected.nix") 9 - ]; 10 - 11 - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; 12 - boot.initrd.kernelModules = [ ]; 13 - boot.kernelModules = [ "kvm-intel" ]; 14 - boot.extraModulePackages = [ ]; 15 - 16 - fileSystems."/" = 17 - { device = "/dev/disk/by-uuid/74364d58-0f18-40e0-a8f3-9ae7cea82314"; 18 - fsType = "ext4"; 19 - }; 20 - 21 - fileSystems."/boot" = 22 - { device = "/dev/disk/by-uuid/336D-E271"; 23 - fsType = "vfat"; 24 - options = [ "fmask=0077" "dmask=0077" ]; 25 - }; 26 - 27 - fileSystems."/home" = 28 - { device = "/dev/disk/by-uuid/67e65287-b81a-47b3-b524-2dfef992c1c8"; 29 - fsType = "ext4"; 30 - }; 31 - 32 - fileSystems."/nix" = 33 - { device = "/dev/disk/by-uuid/2555f81a-2ec4-4f0e-b513-71f26faf2ee6"; 34 - fsType = "ext4"; 35 - }; 36 - 37 - swapDevices = [ ]; 38 - 39 - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 40 - # (the default) this is the recommended approach. When using systemd-networkd it's 41 - # still possible to use this option, but it's recommended to use it in conjunction 42 - # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 43 - networking.useDHCP = lib.mkDefault true; 44 - # networking.interfaces.eno2.useDHCP = lib.mkDefault true; 45 - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; 46 - 47 - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 48 - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 49 - }
-19
machines/nixos/vali/default.nix
··· 1 - { self, inputs, pkgs, hostname, ... }: 2 - { 3 - # Networking 4 - networking.hostName = hostname; 5 - 6 - # Global packages 7 - environment.systemPackages = with pkgs; [ 8 - wget 9 - git 10 - ]; 11 - 12 - # This value determines the NixOS release from which the default 13 - # settings for stateful data, like file locations and database versions 14 - # on your system were taken. It‘s perfectly fine and recommended to leave 15 - # this value at the release version of the first install of this system. 16 - # Before changing this value read the documentation for this option 17 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 18 - system.stateVersion = "24.11"; # Did you read the comment? 19 - }
-36
modules/common/system/garbage-collector.nix
··· 1 - { config, pkgs, lib, ... }: 2 - let 3 - cfg = config.asgard.system.garbageCollector; 4 - in 5 - { 6 - options.asgard.system.garbageCollector = { 7 - enable = lib.mkEnableOption "garbage collection."; 8 - }; 9 - 10 - # Perform garbage collection weekly to maintain low disk usage 11 - config = lib.mkIf cfg.enable (lib.mkMerge [ 12 - # ┌───────────────────────────────┐ 13 - # │ Linux Only | 14 - # └───────────────────────────────┘ 15 - (lib.mkIf pkgs.stdenv.isLinux { 16 - nix.settings.auto-optimise-store = true; 17 - nix.gc = { 18 - automatic = true; 19 - dates = "weekly"; 20 - options = "--delete-older-than 1w"; 21 - }; 22 - }) 23 - 24 - # ┌───────────────────────────────┐ 25 - # │ Darwin Only | 26 - # └───────────────────────────────┘ 27 - # (lib.mkIf pkgs.stdenv.isDarwin { 28 - # nix.gc = { 29 - # automatic = true; 30 - # interval = [{ Weekday = 7; }]; 31 - # options = "--delete-older-than 7d"; 32 - # }; 33 - # nix.optimise.automatic = true; 34 - # }) 35 - ]); 36 - }
modules/darwin/.gitkeep

This is a binary file and will not be displayed.

+24
modules/default.nix
··· 1 + # This files import all modules inside this folder and the subfolders but 2 + # ignore all files and directories starting with a `_`. 3 + { lib, ... }: 4 + let 5 + importDir = dir: 6 + let 7 + entries = builtins.readDir dir; 8 + nixFiles = lib.filterAttrs (name: type: 9 + type == "regular" && 10 + lib.hasSuffix ".nix" name && 11 + name != "default.nix" && 12 + !(lib.hasPrefix "_" name) 13 + ) entries; 14 + subdirs = lib.filterAttrs (name: type: 15 + type == "directory" && 16 + !(lib.hasPrefix "_" name) 17 + ) entries; 18 + in 19 + (map (name: dir + "/${name}") (lib.attrNames nixFiles)) 20 + ++ (lib.concatMap (name: importDir (dir + "/${name}")) (lib.attrNames subdirs)); 21 + in 22 + { 23 + imports = importDir ./.; 24 + }
+100
modules/factories/configuration.nix
··· 1 + { inputs, lib, config, ... }: 2 + let 3 + mkNixos = { hostname, system, modules, hardwareConfig, stateVersion }: 4 + inputs.nixpkgs.lib.nixosSystem { 5 + inherit system; 6 + modules = 7 + modules ++ [ 8 + hardwareConfig 9 + inputs.self.nixosModules.unfree-packages 10 + ({ ... }: { 11 + networking.hostName = hostname; 12 + nix.settings.experimental-features = [ "nix-command" "flakes" ]; 13 + 14 + # This value determines the NixOS release from which the default 15 + # settings for stateful data, like file locations and database versions 16 + # on your system were taken. It‘s perfectly fine and recommended to leave 17 + # this value at the release version of the first install of this system. 18 + # Before changing this value read the documentation for this option 19 + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 20 + system.stateVersion = stateVersion; # Did you read the comment? 21 + })]; 22 + specialArgs = { inherit inputs; }; 23 + }; 24 + 25 + mkDarwin = { hostname, system, modules, stateVersion }: 26 + inputs.darwin.lib.darwinSystem { 27 + inherit system; 28 + modules = [ 29 + inputs.self.darwinModules.unfree-packages 30 + ({ ... }: { 31 + nix.enable = true; 32 + networking.hostName = hostname; 33 + networking.computerName = hostname; 34 + 35 + # Used for backwards compatibility, please read the changelog before changing. 36 + # $ darwin-rebuild changelog 37 + system.stateVersion = stateVersion; 38 + })] ++ modules; 39 + specialArgs = { inherit inputs; }; 40 + }; 41 + 42 + isDarwin = system: 43 + let 44 + parsed = lib.systems.elaborate { system = system; }; 45 + in 46 + parsed.isDarwin; 47 + in 48 + { 49 + options.hosts = lib.mkOption { 50 + type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: { 51 + options = { 52 + hostname = lib.mkOption { 53 + type = lib.types.str; 54 + default = name; 55 + description = "Hostname for this system"; 56 + }; 57 + 58 + system = lib.mkOption { 59 + type = lib.types.str; 60 + default = "x86_64-linux"; 61 + description = "System architecture"; 62 + }; 63 + 64 + modules = lib.mkOption { 65 + type = lib.types.listOf lib.types.unspecified; 66 + default = []; 67 + description = "List of modules to include"; 68 + }; 69 + 70 + hardwareConfig = lib.mkOption { 71 + type = lib.types.path; 72 + default = /etc/nixos/hardware-configuration.nix; 73 + description = "Path to hardware configuration"; 74 + }; 75 + 76 + stateVersion = lib.mkOption { 77 + type = lib.types.str; 78 + default = "24.05"; 79 + description = "State version for the system"; 80 + }; 81 + }; 82 + })); 83 + default = {}; 84 + description = "Host definitions"; 85 + }; 86 + 87 + # NixOS configurations 88 + config.flake.nixosConfigurations = lib.mapAttrs 89 + (name: cfg: mkNixos { 90 + inherit (cfg) hostname system modules hardwareConfig stateVersion; 91 + }) 92 + (lib.filterAttrs (name: cfg: !isDarwin cfg.system) config.hosts); 93 + 94 + # Darwin configurations 95 + config.flake.darwinConfigurations = lib.mapAttrs 96 + (name: cfg: mkDarwin { 97 + inherit (cfg) hostname system modules stateVersion; 98 + }) 99 + (lib.filterAttrs (name: cfg: isDarwin cfg.system) config.hosts); 100 + }
+21
modules/hosts/andhrimnir/configuration.nix
··· 1 + { inputs, ... }: 2 + let 3 + configuration = { ... }: { 4 + imports = with inputs.self.modules.nixos; [ 5 + system-boot-grub 6 + system-garbageCollector 7 + system-audio 8 + system-graphics-nvidia 9 + services-desktops-kdePlasma 10 + neoxa 11 + ]; 12 + 13 + networking.networkmanager.enable = true; 14 + }; 15 + in 16 + { 17 + hosts.andhrimnir = { 18 + system = "x86_64-linux"; 19 + modules = [ configuration ]; 20 + }; 21 + }
+36
modules/hosts/loki/configuration.nix
··· 1 + { inputs, ... }: 2 + let 3 + configuration = { pkgs, ... }: { 4 + imports = with inputs.self.modules.nixos; [ 5 + system-boot-systemd 6 + system-garbageCollector 7 + system-audio 8 + system-graphics-nvidia 9 + services-desktops-gnome 10 + cosmeak 11 + ]; 12 + 13 + environment.systemPackages = with pkgs; [ 14 + git 15 + just 16 + nixd 17 + ]; 18 + 19 + networking.networkmanager.enable = true; 20 + services.printing.enable = false; 21 + 22 + # Steam 23 + programs.steam = { 24 + enable = true; 25 + gamescopeSession.enable = true; 26 + }; 27 + }; 28 + in 29 + { 30 + allowedUnfreePackages = [ "steam" "steam-unwrapped" ]; 31 + 32 + hosts.loki = { 33 + system = "x86_64-linux"; 34 + modules = [ configuration ]; 35 + }; 36 + }
+14
modules/hosts/njord/configuration.nix
··· 1 + { inputs, ... }: 2 + let 3 + configuration = { ... }: { 4 + imports = with inputs.self.modules.darwin; [ 5 + # 6 + ]; 7 + }; 8 + in 9 + { 10 + hosts.njord = { 11 + system = "aarch64-darwin"; 12 + modules = [ configuration ]; 13 + }; 14 + }
+20
modules/hosts/sunna/configuration.nix
··· 1 + { inputs, ... }: 2 + let 3 + configuration = { ... }: { 4 + imports = with inputs.self.modules.nixos; [ 5 + system-boot-systemd 6 + system-garbageCollector 7 + system-audio 8 + system-graphics-nvidia 9 + services-desktops-kdePlasma 10 + ]; 11 + 12 + networking.networkmanager.enable = true; 13 + }; 14 + in 15 + { 16 + hosts.sunna = { 17 + system = "x86_64-linux"; 18 + modules = [ configuration ]; 19 + }; 20 + }
+21
modules/lib/unfree.nix
··· 1 + # modules/nixpkgs/unfree.nix 2 + { lib, config, ... }: 3 + { 4 + options.allowedUnfreePackages = lib.mkOption { 5 + type = lib.types.listOf lib.types.str; 6 + default = []; 7 + description = "List of unfree package names to allow"; 8 + }; 9 + 10 + config = let packages = config.allowedUnfreePackages; in { 11 + flake.nixosModules.unfree-packages = { lib, ... }: { 12 + nixpkgs.config.allowUnfreePredicate = pkg: 13 + builtins.elem (lib.getName pkg) packages; 14 + }; 15 + 16 + flake.darwinModules.unfree-packages = { lib, ... }: { 17 + nixpkgs.config.allowUnfreePredicate = pkg: 18 + builtins.elem (lib.getName pkg) packages; 19 + }; 20 + }; 21 + }
-21
modules/nixos/hardware/audio.nix
··· 1 - { config, lib, ... }: 2 - let 3 - cfg = config.asgard.hardware.audio; 4 - in 5 - { 6 - options.asgard.hardware.audio = { 7 - enable = lib.mkEnableOption "Enable opinated audio configuration."; 8 - }; 9 - 10 - config = lib.mkIf cfg.enable { 11 - services.pulseaudio.enable = lib.mkForce false; 12 - security.rtkit.enable = true; 13 - services.pipewire = { 14 - enable = true; 15 - alsa.enable = true; 16 - alsa.support32Bit = true; 17 - pulse.enable = true; 18 - jack.enable = true; 19 - }; 20 - }; 21 - }
+16
modules/services/desktops/gnome.nix
··· 1 + { 2 + flake.modules.nixos.services-desktops-gnome = { pkgs, ... }: { 3 + services.displayManager.gdm.enable = true; 4 + services.displayManager.autoLogin.enable = true; 5 + services.displayManager.autoLogin.user = "cosmeak"; 6 + services.desktopManager.gnome.enable = true; 7 + services.gnome.games.enable = false; 8 + services.gnome.core-developer-tools.enable = false; 9 + environment.gnome.excludePackages = with pkgs; [ 10 + gnome-tour 11 + gnome-user-docs 12 + gnome-text-editor 13 + gnome-console 14 + ]; 15 + }; 16 + }
+7
modules/services/desktops/kdePlasma.nix
··· 1 + { 2 + flake.modules.nixos.services-desktops-kdePlasma = { ... }: { 3 + services.displayManager.sddm.enable = true; 4 + services.displayManager.sddm.wayland.enable = true; 5 + services.desktopManager.plasma6.enable = true; 6 + }; 7 + }
+6
modules/services/display-managers/auto-login.nix
··· 1 + { 2 + flake.modules.nixos.services-displayManagers-autoLogin = username: { 3 + services.displayManager.autoLogin.enable = true; 4 + services.displayManager.autoLogin.user = username; 5 + }; 6 + }
+14
modules/system/audio.nix
··· 1 + { lib, ... }: 2 + { 3 + flake.modules.nixos.system-audio = { ... }: { 4 + services.pulseaudio.enable = lib.mkForce false; 5 + security.rtkit.enable = true; 6 + services.pipewire = { 7 + enable = true; 8 + alsa.enable = true; 9 + alsa.support32Bit = true; 10 + pulse.enable = true; 11 + jack.enable = true; 12 + }; 13 + }; 14 + }
+9
modules/system/boot/grub.nix
··· 1 + { 2 + flake.modules.nixos.system-boot-grub = { ... }: { 3 + boot.loader.grub.enable = true; 4 + boot.loader.grub.device = "nodev"; 5 + boot.loader.grub.useOSProber = true; 6 + boot.loader.grub.efiSupport = true; 7 + boot.loader.efi.canTouchEfiVariables = true; 8 + }; 9 + }
+8
modules/system/boot/systemd-boot.nix
··· 1 + { 2 + # EFI Bootloader 3 + flake.modules.nixos.system-boot-systemd = { ... }: { 4 + boot.loader.systemd-boot.enable = true; 5 + boot.loader.efi.canTouchEfiVariables = true; 6 + boot.loader.systemd-boot.configurationLimit = 10; 7 + }; 8 + }
+19
modules/system/garbage-collector.nix
··· 1 + { 2 + flake.modules.nixos.system-garbageCollector = { ... }: { 3 + nix.settings.auto-optimise-store = true; 4 + nix.gc = { 5 + automatic = true; 6 + dates = "weekly"; 7 + options = "--delete-older-than 1w"; 8 + }; 9 + }; 10 + 11 + flake.modules.darwin.system.garbageCollector = { ... }: { 12 + nix.gc = { 13 + automatic = true; 14 + interval = [{ Weekday = 7; }]; 15 + options = "--delete-older-than 7d"; 16 + }; 17 + nix.optimise.automatic = true; 18 + }; 19 + }
+15
modules/system/graphics/nvidia.nix
··· 1 + { 2 + allowedUnfreePackages = [ "nvidia-x11" "nvidia-settings" ]; 3 + 4 + flake.modules.nixos.system-graphics-nvidia = { config, ... }: { 5 + hardware.nvidia = { 6 + package = config.boot.kernelPackages.nvidiaPackages.latest; 7 + modesetting.enable = true; 8 + powerManagement.enable = false; 9 + powerManagement.finegrained = false; 10 + open = false; 11 + nvidiaSettings = true; 12 + }; 13 + services.xserver.videoDrivers = [ "nvidia" ]; 14 + }; 15 + }
+51
modules/users/cosmeak.nix
··· 1 + { ... }: 2 + let 3 + username = "cosmeak"; 4 + 5 + # Shared packages between all my machines (nixos or darwin) 6 + # where I used it at a normal user 7 + sharedPackages = pkgs: with pkgs; [ 8 + _1password-gui 9 + bat 10 + code-cursor 11 + helix 12 + lazygit 13 + librewolf 14 + obsidian 15 + spotify 16 + starship 17 + vesktop 18 + zed-editor 19 + zoxide 20 + ]; 21 + in 22 + { 23 + allowedUnfreePackages = [ "1password" "cursor" "obsidian" "spotify" ]; 24 + 25 + flake.modules.nixos.${username} = { pkgs, ... }: { 26 + users.users.${username} = { 27 + isNormalUser = true; 28 + extraGroups = [ "networkmanager" "wheel" ]; 29 + packages = with pkgs; [ 30 + heroic # Game Launcher (Epic Games, GOG) 31 + obs-studio # Recording App 32 + prismlauncher # Minecraft launcher 33 + chirp # Radio programming tool 34 + ] ++ (sharedPackages pkgs); 35 + }; 36 + }; 37 + 38 + flake.modules.darwin.${username} = { pkgs, ... }: { 39 + users.users.${username} = { 40 + packages = with pkgs; [ 41 + alt-tab-macos # alt tab like windows on macos 42 + bruno # IDE for testing apis 43 + dbeaver-bin # Database client 44 + stats # System monitoring displayed in macos top bar - will be replaced by custom script with sketchybar 45 + podman # container tool -> replacement of docker 46 + podman-compose # compose provider for podman 47 + raycast # replacement for spotlight 48 + ] ++ (sharedPackages pkgs); 49 + }; 50 + }; 51 + }
+22
modules/users/neoxa.nix
··· 1 + { ... }: 2 + let 3 + username = "neoxa"; 4 + in 5 + { 6 + allowedUnfreePackages = [ "steam" "steam-unwrapped" "spotify" ]; 7 + 8 + flake.modules.nixos.${username} = { pkgs, ... }: { 9 + users.users.${username} = { 10 + isNormalUser = true; 11 + extraGroups = [ "networkmanager" "wheel" ]; 12 + packages = with pkgs; [ 13 + heroic 14 + librewolf 15 + lutris 16 + spotify 17 + vesktop 18 + vscodium 19 + ]; 20 + }; 21 + }; 22 + }