Nix Flakes configuration for MacOS, NixOS and WSL
0
fork

Configure Feed

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

feat: update configurations

cosmeak ed971811 cdd39d08

+113 -237
+4 -74
flake.lock
··· 21 21 "type": "github" 22 22 } 23 23 }, 24 - "flake-compat": { 25 - "flake": false, 26 - "locked": { 27 - "lastModified": 1747046372, 28 - "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", 29 - "owner": "edolstra", 30 - "repo": "flake-compat", 31 - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", 32 - "type": "github" 33 - }, 34 - "original": { 35 - "owner": "edolstra", 36 - "repo": "flake-compat", 37 - "type": "github" 38 - } 39 - }, 40 - "hardware": { 41 - "locked": { 42 - "lastModified": 1755330281, 43 - "narHash": "sha256-aJHFJWP9AuI8jUGzI77LYcSlkA9wJnOIg4ZqftwNGXA=", 44 - "owner": "NixOS", 45 - "repo": "nixos-hardware", 46 - "rev": "3dac8a872557e0ca8c083cdcfc2f218d18e113b0", 47 - "type": "github" 48 - }, 49 - "original": { 50 - "owner": "NixOS", 51 - "ref": "master", 52 - "repo": "nixos-hardware", 53 - "type": "github" 54 - } 55 - }, 56 24 "nixpkgs": { 57 25 "locked": { 58 - "lastModified": 1755274400, 59 - "narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=", 26 + "lastModified": 1757020766, 27 + "narHash": "sha256-PLoSjHRa2bUbi1x9HoXgTx2AiuzNXs54c8omhadyvp0=", 60 28 "owner": "nixos", 61 29 "repo": "nixpkgs", 62 - "rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899", 30 + "rev": "fe83bbdde2ccdc2cb9573aa846abe8363f79a97a", 63 31 "type": "github" 64 32 }, 65 33 "original": { ··· 69 37 "type": "github" 70 38 } 71 39 }, 72 - "nixpkgs_2": { 73 - "locked": { 74 - "lastModified": 1754725699, 75 - "narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=", 76 - "owner": "NixOS", 77 - "repo": "nixpkgs", 78 - "rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054", 79 - "type": "github" 80 - }, 81 - "original": { 82 - "owner": "NixOS", 83 - "ref": "nixos-unstable", 84 - "repo": "nixpkgs", 85 - "type": "github" 86 - } 87 - }, 88 40 "root": { 89 41 "inputs": { 90 42 "darwin": "darwin", 91 - "hardware": "hardware", 92 - "nixpkgs": "nixpkgs", 93 - "wsl": "wsl" 94 - } 95 - }, 96 - "wsl": { 97 - "inputs": { 98 - "flake-compat": "flake-compat", 99 - "nixpkgs": "nixpkgs_2" 100 - }, 101 - "locked": { 102 - "lastModified": 1755261305, 103 - "narHash": "sha256-EOqCupB5X5WoGVHVcfOZcqy0SbKWNuY3kq+lj1wHdu8=", 104 - "owner": "nix-community", 105 - "repo": "NixOS-WSL", 106 - "rev": "203a7b463f307c60026136dd1191d9001c43457f", 107 - "type": "github" 108 - }, 109 - "original": { 110 - "owner": "nix-community", 111 - "ref": "main", 112 - "repo": "NixOS-WSL", 113 - "type": "github" 43 + "nixpkgs": "nixpkgs" 114 44 } 115 45 } 116 46 },
+15 -43
flake.nix
··· 9 9 # packages 10 10 nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05"; 11 11 12 - # Special hardware 13 - hardware.url = "github:NixOS/nixos-hardware/master"; 14 - 15 12 # Macos modules 16 13 darwin = { 17 14 url = "github:nix-darwin/nix-darwin?ref=nix-darwin-25.05"; 18 15 inputs.nixpkgs.follows= "nixpkgs"; 19 16 }; 20 - 21 - # WSL modules 22 - wsl.url = "github:nix-community/NixOS-WSL/main"; 23 17 }; 24 18 25 19 # Force some nix configurations globally ··· 48 42 modules = [ ./machines/nixos/loki ] ++ nixosModules; 49 43 }; 50 44 51 - # Little server for testing things 52 - vali = nixpkgs.lib.nixosSystem { 45 + # Asus Rog G15 (work/gaming) 46 + sunna = nixpkgs.lib.nixosSystem { 53 47 system = "x86_64-linux"; 54 48 specialArgs = { 55 49 inherit inputs; 56 - hostname = "vali"; 50 + hostname = "sunna"; 57 51 }; 58 - modules = [ 59 - inputs.wsl.nixosModules.default 60 - ./machines/nixos/vali 61 - ] ++ nixosModules; 52 + modules = [ ./machines/nixos/sunna ] ++ nixosModules; 62 53 }; 63 54 64 - # Asus Rog G15 WSl 65 - sunna = nixpkgs.lib.nixosSystem { 55 + # Little server for testing things 56 + vali = nixpkgs.lib.nixosSystem { 66 57 system = "x86_64-linux"; 67 58 specialArgs = { 68 59 inherit inputs; 69 - hostname = "sunna"; 60 + hostname = "vali"; 70 61 }; 71 - modules = [ 72 - inputs.wsl.nixosModules.default 73 - ./machines/nixos/sunna 74 - ]; 62 + modules = [ ./machines/nixos/vali ] ++ nixosModules; 75 63 }; 76 64 77 65 # Rapsberry Pi 3b+ ··· 83 71 }; 84 72 modules = [ 85 73 ./machines/nixos/hoenir 86 - inputs.hardware.nixosModules.raspberry-pi-4 87 74 "${nixpkgs}/nixos/modules/profiles/minimal.nix" 88 75 ] ++ nixosModules; 89 76 }; 90 77 }; 91 78 92 - # Macos configurations 93 - darwinConfigurations = { 94 - # Macbook Pro M2 95 - njord = inputs.darwin.lib.darwinSystem { 96 - system = "aarch64-darwin"; 97 - specialArgs = { 98 - inherit inputs; 99 - hostname = "njord"; 100 - }; 101 - modules = [ ./machines/darwin/njord ] ++ darwinModules; 79 + # Macbook Pro M2 80 + darwinConfigurations.njord = inputs.darwin.lib.darwinSystem { 81 + system = "aarch64-darwin"; 82 + specialArgs = { 83 + inherit inputs; 84 + hostname = "njord"; 102 85 }; 86 + modules = [ ./machines/darwin/njord ] ++ darwinModules; 103 87 }; 104 - 105 - # Development shells 106 - devShells = lib.forAllSystems(system: 107 - let 108 - pkgs = import nixpkgs { inherit system; }; 109 - in 110 - { 111 - default = pkgs.mkShell ({ 112 - buildInputs = with pkgs; [ just nixd ]; 113 - }); 114 - } 115 - ); 116 88 }; 117 89 }
+1 -69
machines/nixos/hoenir/default.nix
··· 1 1 { config, pkgs, inputs, lib, hostname,... }: 2 2 { 3 - imports = [ 4 - # Raspberry Pi 3 hardware module 5 - inputs.hardware.nixosModules.raspberry-pi-3 6 - ]; 7 - 8 - # Disable some modules 9 - disabledModules = [ "profiles/base.nix" ]; 10 - 11 - # Used to build image/version 12 - nixpkgs.hostPlatform.system = "aarch64-linux"; 13 - 14 - # Allow licensed firmware to be update 15 - hardware.enableRedistributableFirmware = true; 16 - 17 - # Early boot 18 - boot.initrd.kernelModules = [ "vc4" "bcm2835_dma" "i2c_bcm2835" ]; 3 + imports = [ ]; 19 4 20 5 # Network 21 6 networking.hostName = hostname; 22 7 23 - # Time 24 - time.timeZone = "Europe/Paris"; 25 - 26 8 # Enable ssh 27 9 services.openssh.enable = true; 28 - 29 - 30 - # Auto login to magnetis user on startup 31 - services.displayManager.autoLogin.enable = true; 32 - services.displayManager.autoLogin.user = "magnetis"; 33 - services.getty.autologinUser = "magnetis"; 34 - 35 - # Environment wide packages 36 - environment.systemPackages = with pkgs; [ 37 - libraspberrypi 38 - git 39 - ]; 40 - 41 - # Configure users 42 - users.mutableUsers = true; 43 - users.users.cosmeak = { 44 - isNormalUser = true; 45 - extraGroups = [ "networkmanager" "wheel" ]; # wheel = admin 46 - }; 47 - 48 - # Nix settings 49 - nix.settings.experimental-features = "nix-command flakes"; 50 - 51 - # Perform garbage collection weekly to maintain low disk usage 52 - asgard.system.garbageCollector.enable = true; 53 - asgard.system.autoUpdate.enable = false; 54 - 55 - # Optimize storage 56 - nix.settings.auto-optimise-store = true; 57 - 58 - # Minecraft Server 59 - services.minecraft-server = { 60 - enable = true; 61 - eula = true; 62 - openFirewall = true; # Opens the port the server is running on (by default 25565) 63 - declarative = true; 64 - serverProperties = { 65 - difficulty = 3; 66 - gamemode = 1; 67 - max-players = 5; 68 - motd = "NixOS Minecraft server!"; 69 - white-list = false; 70 - }; 71 - }; 72 - 73 - # Swap file 74 - swapDevices = [{ 75 - device = "/swapfile"; 76 - size = 1024; # 1GB 77 - }]; 78 10 79 11 # This value determines the NixOS release from which the default 80 12 # settings for stateful data, like file locations and database versions
+8 -3
machines/nixos/loki/default.nix
··· 43 43 networking.hostName = hostname; 44 44 45 45 # Desktop Environment 46 - services.displayManager.cosmic-greeter.enable = true; 47 - services.desktopManager.cosmic.enable = true; 48 - services.desktopManager.cosmic.xwayland.enable = true; 46 + services.xserver.enable = true; 47 + services.xserver.displayManager.gdm.enable = true; 48 + services.xserver.desktopManager.gnome.enable = true; 49 + services.xserver.displayManager.gdm.wayland = true; 49 50 services.displayManager.autoLogin.enable = true; 50 51 services.displayManager.autoLogin.user = "cosmeak"; 51 52 ··· 60 61 starship 61 62 zed-editor 62 63 gale 64 + gnome-tweaks 65 + adwaita-icon-theme 66 + just 67 + nixd 63 68 ]; 64 69 65 70 # Suites of packages (opiniated collection)
+69 -11
machines/nixos/sunna/default.nix
··· 1 1 { self, inputs, pkgs, hostname, ... }: 2 2 { 3 - # WSL configuration 4 - wsl.enable = true; 5 - wsl.docker-desktop.enable = true; 6 - 7 3 # Networking 8 4 networking.hostName = hostname; 9 5 6 + # GRUB Bootloader 7 + boot.loader.grub.enable = true; 8 + boot.loader.grub.device = "nodev"; 9 + boot.loader.grub.useOSProber = true; 10 + 11 + # Desktop Environment 12 + services.desktopManager.plasma6.enable = true; 13 + 10 14 # Global packages 11 15 environment.systemPackages = with pkgs; [ 12 - git 13 - lazygit 16 + wget 17 + git 18 + curl 19 + vscodium 14 20 ]; 15 21 16 - # Required to use it as vscode remote 17 - programs.nix-ld = { 18 - enable = true; 22 + # Audio 23 + asgard.hardware.audio.enable = true; 24 + 25 + # Lang 26 + i18n.defaultLocale = "fr_FR.UTF-8"; 27 + 28 + # Gaming settings 29 + programs.steam.enable = true; 30 + programs.steam.gamescopeSession.enable = true; 31 + programs.steam.gamescopeSession.env = { 32 + __NV_PRIME_RENDER_OFFLOAD = 1; 33 + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; 34 + __VK_LAYER_NV_optimus = "NVIDIA_ONLY" 19 35 }; 20 36 37 + # Nvidia 38 + hardware.graphic = { 39 + enable = true; 40 + enable32Bit = true; 41 + }; 42 + hardware.nvidia = { 43 + pacakges = config.boot.kernelPackages.nvidiaPackages.latest; 44 + modsetting.enable = true; 45 + powerManagement.enable = true; 46 + powerManagement.finegrained = true; 47 + open = false; 48 + nvidiaSettings = true; 49 + }; 50 + 51 + # Users 52 + users.users = { 53 + "neoxa" = { 54 + isNormalUser = true; 55 + extraGroups = [ "networkmanager" "wheel" ]; 56 + packages = with pkgs; [ 57 + spotify 58 + vesktop 59 + heroic 60 + 61 + # Needed for school 62 + blender 63 + unityhub 64 + obs-studio 65 + 66 + # Coding environment for school 67 + php 68 + php84Packages.composer 69 + nodejs_22 70 + python313 71 + ]; 72 + }; 73 + }; 74 + 75 + # Nix settings 76 + asgard.system.garbageCollector.enable = true; 77 + nixpkgs.config.allowUnfree = true; 78 + 21 79 # Enable flakes and other experimental features 22 80 nix.settings.experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; 23 - 81 + 24 82 # Change buffer download size to 500Mo 25 83 nix.settings.download-buffer-size = 524288000; 26 84 ··· 31 89 # Before changing this value read the documentation for this option 32 90 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 33 91 system.stateVersion = "25.05"; # Did you read the comment? 34 - } 92 + }
+1 -22
machines/nixos/vali/default.nix
··· 1 1 { self, inputs, pkgs, hostname, ... }: 2 2 { 3 - # WSL configuration 4 - wsl.enable = true; 5 - wsl.docker-desktop.enable = true; 6 - 7 3 # Networking 8 4 networking.hostName = hostname; 9 5 10 6 # Global packages 11 7 environment.systemPackages = with pkgs; [ 12 - git 13 - lazygit 14 8 wget 15 - php84 16 - nodejs_22 9 + git 17 10 ]; 18 - 19 - # Required to use it as vscode remote 20 - programs.nix-ld = { 21 - enable = true; 22 - }; 23 - 24 - # Emulate system for building others 25 - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; 26 - 27 - # Enable flakes and other experimental features 28 - nix.settings.experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; 29 - 30 - # Change buffer download size to 500Mo 31 - nix.settings.download-buffer-size = 524288000; 32 11 33 12 # This value determines the NixOS release from which the default 34 13 # settings for stateful data, like file locations and database versions
+4 -4
modules/common/suites/base.nix
··· 19 19 ]; 20 20 21 21 # Only define homebrew.casks if on Darwin 22 - homebrew.casks = lib.mkIf pkgs.stdenv.isDarwin [ 23 - "discord" 24 - "ghostty" 25 - ]; 22 + # homebrew.casks = lib.mkIf pkgs.stdenv.isDarwin [ 23 + # "discord" 24 + # "ghostty" 25 + # ]; 26 26 }; 27 27 }
+8 -8
modules/common/system/garbage-collector.nix
··· 24 24 # ┌───────────────────────────────┐ 25 25 # │ Darwin Only | 26 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 - }) 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 35 ]); 36 36 }
+1 -1
modules/nixos/hardware/nvidia.nix
··· 23 23 enable32Bit = cfg.withOpenGL; 24 24 }; 25 25 services.xserver.videoDrivers = [ "nvidia" ]; 26 - hardware.nvidia = { 26 + hardware.nvidia = { 27 27 package = config.boot.kernelPackages.nvidiaPackages.latest; 28 28 modesetting.enable = true; 29 29 powerManagement.enable = false;
+1 -2
users/ben/andhrimnir/default.nix
··· 1 1 { inputs, pkgs, ...}: 2 2 { 3 3 users.users."ben" = { 4 - isNormalUser = ben; 5 - description = "cosmeak"; 4 + isNormalUser = true; 6 5 extraGroups = [ "wheel" ]; 7 6 8 7 # User wide packages
+1
users/cosmeak/loki/default.nix
··· 15 15 obsidian 16 16 spotify 17 17 _1password-gui 18 + vesktop 18 19 ]; 19 20 }; 20 21 }