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: global cleaning configurations

cosmeak dd1d5514 a9f96327

+104 -279
+3 -3
README.md
··· 49 49 | :------------- | :-------------------------------- | :------------------- | :------------ | :--: | :-: | :------: | :----: | 50 50 | `njord` | - | Apple M2 Pro | Apple M2 Pro | 32Go | 🍎️ | ⌨️ | 🟢️ | 51 51 | `loki` | ASUS ROG STRIX B760-I GAMING WIFI | Intel i5 13600kf | Nvidia 4070ti | 32Go | ❄️ | 🎮️ | 🟢️ | 52 - | `lithium` | Raspberry Pi3 b+ | - | - | 1Go | ❄️ | 🧨️ | 🟠 | 53 - | `vali` | WSL | - | - | 8Go | ❄️ | ⌨️ | 🟢️ | 52 + | `lithium` | Raspberry Pi3 b+ | - | - | 1Go | ❄️ | 🧨️ | 💾️ | 53 + | `vali` | WSL | - | - | 8Go | ❄️ | 💾️ | 🔴 | 54 54 | `andhrimnir ` | Aorus B450 Elite | AMD Ryzen 3 3300X | Nvidia 1060 | 16Go | ❄️ | 🎮️ / ⌨️ | 🟠 | 55 55 | `elli` | HP ProDesk 400 G1 DM | Intel Pentium G3250T | - | 8Go | ❄️ | 💾️ | 🔴 | 56 56 | `sunna` | ASUS ROG STRIX G15 | Intel i7 10870H | Nvidia 2060 | 16Go | ❄️ | 🖥️ | 🟠 | ··· 76 76 . 77 77 ├── lib # Asgard custom libary to help configure machines and users 78 78 ├── machines # Machine configurations 79 - │ └── <os> 79 + │ └── <os> 80 80 │ │ └── <hostname> 81 81 ├── modules # Asgard custom modules by os 82 82 │ ├── commons
-24
flake.nix
··· 30 30 nixosModules = lib.fs.getFilesRecursively ./modules/nixos ++ common; 31 31 darwinModules = lib.fs.getFilesRecursively ./modules/darwin ++ common; 32 32 in { 33 - # Nixos Configurations 34 33 nixosConfigurations = { 35 34 # Gaming config (console like) 36 35 loki = nixpkgs.lib.nixosSystem { ··· 50 49 hostname = "sunna"; 51 50 }; 52 51 modules = [ ./machines/nixos/sunna ] ++ nixosModules; 53 - }; 54 - 55 - # Little server for testing things 56 - vali = nixpkgs.lib.nixosSystem { 57 - system = "x86_64-linux"; 58 - specialArgs = { 59 - inherit inputs; 60 - hostname = "vali"; 61 - }; 62 - modules = [ ./machines/nixos/vali ] ++ nixosModules; 63 - }; 64 - 65 - # Rapsberry Pi 3b+ 66 - hoenir = nixpkgs.lib.nixosSystem { 67 - system = "aarch64-linux"; 68 - specialArgs = { 69 - inherit inputs; 70 - hostname = "hoenir"; 71 - }; 72 - modules = [ 73 - ./machines/nixos/hoenir 74 - "${nixpkgs}/nixos/modules/profiles/minimal.nix" 75 - ] ++ nixosModules; 76 52 }; 77 53 }; 78 54
+24 -13
machines/darwin/njord/default.nix
··· 1 - { self, inputs, pkgs, hostname, ... }: 1 + { pkgs, hostname, ... }: 2 2 { 3 3 imports = [ 4 4 ./homebrew ··· 15 15 # Timezone 16 16 time.timeZone = "Europe/Paris"; 17 17 18 - # System wide packages 19 - environment.systemPackages = with pkgs; [ 20 - stats # System monitoring displayed in macos top bar - will be replaced by custom script with sketchybar 21 - raycast # replacement for spotlight 22 - alt-tab-macos # alt tab like windows on macos 23 - ]; 18 + # System wide programs 19 + programs._1password-gui.enable = true; # Password manager 20 + 21 + # Users 22 + users.users."cosmeak" = { 23 + packages = with pkgs; [ 24 + alt-tab-macos # alt tab like windows on macos 25 + bruno # ide for testing apis 26 + dbeaver-bin # database client 27 + ghostty # terminal emulator 28 + git # versionning tool 29 + helix # modal code editor 30 + lazygit # git tui helper 31 + librewolf # web browser 32 + obsidian # note taking 33 + stats # System monitoring displayed in macos top bar - will be replaced by custom script with sketchybar 34 + spotify # music player 35 + podman # container tool -> replacement of docker 36 + podman-compose # compose provider for podman 37 + raycast # replacement for spotlight 38 + zed-editor # gui code editor 39 + ]; 40 + }; 24 41 25 42 # Add environment variables to the system 26 43 environment.variables = { 27 44 EDITOR = "zeditor"; 28 45 }; 29 - 30 - programs._1password.enable = true; # Password manager 31 - 32 - # Complete suite for a specific purpose reused by multiple machines/users 33 - asgard.suites.base.enable = true; 34 - asgard.suites.development.enable = true; 35 46 36 47 # Linux builder 37 48 nix = {
+5 -1
machines/darwin/njord/homebrew/default.nix
··· 3 3 imports = [ 4 4 ./brews.nix 5 5 ./casks.nix 6 - ./masapps.nix 7 6 ]; 8 7 9 8 homebrew.enable = true; ··· 18 17 homebrew.taps = [ 19 18 "mczachurski/wallpapper" 20 19 ]; 20 + 21 + # Apps from App Store - Just used for XCode because not avalaible somewhere else 22 + homebrew.masApps = { 23 + Xcode = 497799835; 24 + }; 21 25 }
-7
machines/darwin/njord/homebrew/masapps.nix
··· 1 - { 2 - # Apps from App Store 3 - homebrew.masApps = { 4 - Xcode = 497799835; 5 - Slack = 803453959; 6 - }; 7 - }
-2
machines/darwin/njord/system/default.nix
··· 15 15 system.defaults = { 16 16 # Deactivate state manager 17 17 WindowManager.GloballyEnabled = false; 18 - # Text show in the login window 19 - loginwindow.LoginwindowText = "Maybe you cannot touch me"; 20 18 }; 21 19 }
+30 -20
machines/nixos/andhrimnir/default.nix
··· 1 - { self, inputs, pkgs, hostname, ... }: 1 + { self, pkgs, hostname, ... }: 2 2 { 3 3 imports = [ 4 4 ./hardware.nix ··· 13 13 boot.loader.efi.canTouchEfiVariables = true; 14 14 15 15 # Locales 16 - i18n.defaultLocale = "en_US.UTF-8"; 17 - i18n.extraLocaleSettings = { 18 - LC_ADDRESS = "fr_FR.UTF-8"; 19 - LC_IDENTIFICATION = "fr_FR.UTF-8"; 20 - LC_MEASUREMENT = "fr_FR.UTF-8"; 21 - LC_MONETARY = "fr_FR.UTF-8"; 22 - LC_NAME = "fr_FR.UTF-8"; 23 - LC_NUMERIC = "fr_FR.UTF-8"; 24 - LC_PAPER = "fr_FR.UTF-8"; 25 - LC_TELEPHONE = "fr_FR.UTF-8"; 26 - LC_TIME = "fr_FR.UTF-8"; 27 - }; 16 + i18n.defaultLocale = "fr_FR.UTF-8"; 28 17 29 18 # Timezone 30 19 time.timeZone = "Europe/Paris"; ··· 39 28 # Audio 40 29 asgard.hardware.audio.enable = true; 41 30 42 - # Nvida GPU 43 - asgard.hardware.nvidia.enable = true; 31 + # Nvidia GPU and OpenGL 32 + hardware.graphics = { 33 + enable = true; 34 + enable32Bit = true; 35 + }; 36 + services.xserver.videoDrivers = [ "nvidia" ]; 37 + hardware.nvidia = { 38 + package = self.boot.kernelPackages.nvidiaPackages.latest; 39 + modesetting.enable = true; 40 + powerManagement.enable = false; 41 + powerManagement.finegrained = false; 42 + open = false; 43 + nvidiaSettings = true; 44 + }; 44 45 45 46 # Disable CUPS since this desktop will not print something. 46 47 services.printing.enable = false; ··· 54 55 # Packages 55 56 environment.systemPackages = with pkgs; [ 56 57 git 57 - brave 58 - btop 59 - unzip 60 58 ]; 61 - asgard.programs.steam.enable = true; 59 + 60 + users.users."neoxa" = { 61 + isNormalUser = true; 62 + extraGroups = [ "wheel" ]; 63 + 64 + # User wide packages 65 + packages = with pkgs; [ 66 + spotify 67 + vesktop 68 + vscode 69 + lutris 70 + ]; 71 + }; 62 72 63 73 # Automatic login 64 74 services.displayManager.autoLogin.enable = true; 65 75 services.displayManager.autoLogin.user = "benjamin"; 66 - 76 + 67 77 # Desktop 68 78 services.xserver.enable = true; 69 79 services.xserver.displayManager.gdm.enable = true;
+37 -18
machines/nixos/loki/default.nix
··· 1 - { self, inputs, pkgs, hostname, ... }: 1 + { self, pkgs, hostname, ... }: 2 2 { 3 3 imports = [ 4 4 ./hardware.nix 5 - 6 - # Import users 7 - ../../../users/cosmeak/loki 8 5 ]; 9 6 10 7 # EFI Bootloader ··· 36 33 asgard.hardware.audio.enable = true; 37 34 38 35 # Nvidia GPU and OpenGL 39 - asgard.hardware.nvidia.enable = true; 36 + hardware.graphics = { 37 + enable = true; 38 + enable32Bit = true; 39 + }; 40 + services.xserver.videoDrivers = [ "nvidia" ]; 41 + hardware.nvidia = { 42 + package = self.boot.kernelPackages.nvidiaPackages.latest; 43 + modesetting.enable = true; 44 + powerManagement.enable = false; 45 + powerManagement.finegrained = false; 46 + open = false; 47 + nvidiaSettings = true; 48 + }; 40 49 41 50 # Networking 42 51 networking.networkmanager.enable = true; ··· 52 61 53 62 # Global packages 54 63 environment.systemPackages = with pkgs; [ 55 - bat 56 - eza 57 - fzf 58 - zoxide 59 - tree 64 + adwaita-icon-theme 60 65 git 61 - starship 62 - zed-editor 63 - gale 64 66 gnome-tweaks 65 - adwaita-icon-theme 66 67 just 67 68 nixd 68 69 ]; 69 70 70 - # Suites of packages (opiniated collection) 71 - asgard.suites.base.enable = true; 71 + # Users 72 + users.users."cosmeak" = { 73 + isNormalUser = true; 74 + description = "cosmeak"; 75 + extraGroups = [ "networkmanager" "wheel" ]; 76 + packages = with pkgs; [ 77 + _1password-gui 78 + ghostty 79 + librewolf 80 + obs-studio 81 + obsidian 82 + prismlauncher 83 + spotify 84 + vesktop 85 + zed-editor 86 + ]; 87 + }; 72 88 73 89 # Steam 74 - asgard.programs.steam.enable = true; 90 + programs.steam = { 91 + enable = true; 92 + gamescopeSession.enable = true; 93 + }; 75 94 76 95 # Disable CUPS since this desktop will not print something. 77 96 services.printing.enable = false; 97 + 78 98 # Common system configurations 79 99 asgard.system.garbageCollector.enable = true; 80 - asgard.system.autoUpdate.enable = false; 81 100 82 101 # Enable unfree packages 83 102 nixpkgs.config.allowUnfree = true;
+1 -1
machines/nixos/loki/hardware.nix
··· 1 1 # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 2 # and may be overwritten by future invocations. Please make changes 3 3 # to /etc/nixos/configuration.nix instead. 4 - { config, lib, pkgs, modulesPath, ... }: 4 + { config, lib, modulesPath, ... }: 5 5 { 6 6 imports = 7 7 [ (modulesPath + "/installer/scan/not-detected.nix")
-27
modules/common/suites/base.nix
··· 1 - { config, pkgs, lib, ... }: 2 - let 3 - cfg = config.asgard.suites.base; 4 - in 5 - { 6 - options.asgard.suites.base = { 7 - enable = lib.mkEnableOption "Enable the base suite."; 8 - }; 9 - 10 - # collection of opiniated package to use as a base 11 - config = lib.mkIf cfg.enable { 12 - environment.systemPackages = with pkgs; [ 13 - librewolf 14 - obsidian 15 - spotify 16 - ] ++ lib.optionals pkgs.stdenv.isLinux [ 17 - discord 18 - ghostty 19 - ]; 20 - 21 - # Only define homebrew.casks if on Darwin 22 - # homebrew.casks = lib.mkIf pkgs.stdenv.isDarwin [ 23 - # "discord" 24 - # "ghostty" 25 - # ]; 26 - }; 27 - }
-22
modules/common/suites/development.nix
··· 1 - { config, pkgs, lib, ... }: 2 - let 3 - cfg = config.asgard.suites.development; 4 - in 5 - { 6 - options.asgard.suites.development = { 7 - enable = lib.mkEnableOption "Enable the development suite."; 8 - }; 9 - 10 - config = lib.mkIf cfg.enable ({ 11 - environment.systemPackages = with pkgs; [ 12 - zed-editor # gui code editor 13 - helix # modal code editor 14 - bruno # ide for testing apis 15 - dbeaver-bin # database client 16 - git # versionning tool 17 - lazygit # git tui helper 18 - podman # container tool -> replacement of docker 19 - podman-compose # compose provider for podman 20 - ]; 21 - }); 22 - }
+4 -4
modules/nixos/hardware/audio.nix
··· 1 - { config, pkgs, lib, ... }: 1 + { config, lib, ... }: 2 2 let 3 3 cfg = config.asgard.hardware.audio; 4 4 in ··· 7 7 enable = lib.mkEnableOption "Enable opinated audio configuration."; 8 8 }; 9 9 10 - config = lib.mkIf cfg.enable ({ 11 - services.pulseaudio.enable = false; 10 + config = lib.mkIf cfg.enable { 11 + services.pulseaudio.enable = lib.mkForce false; 12 12 security.rtkit.enable = true; 13 13 services.pipewire = { 14 14 enable = true; ··· 17 17 pulse.enable = true; 18 18 jack.enable = true; 19 19 }; 20 - }); 20 + }; 21 21 }
-35
modules/nixos/hardware/nvidia.nix
··· 1 - { config, pkgs, lib, ... }: 2 - let 3 - cfg = config.asgard.hardware.nvidia; 4 - in 5 - { 6 - options.asgard.hardware.nvidia = { 7 - enable = lib.mkEnableOption "Enable an opiniated configuration for NVIDIA gpus."; 8 - withOpenGL = lib.mkOption { 9 - type = lib.types.bool; 10 - default = true; 11 - description = "Choose to disable Open GL."; 12 - }; 13 - # package = lib.mkOption { 14 - # type = with lib.types.package; 15 - # default = config.boot.kernelPackages.nvidiaPackages.latest; 16 - # description = "Choose a different version of NVIDIA drivers."; 17 - # }; 18 - }; 19 - 20 - config = lib.mkIf cfg.enable ({ 21 - hardware.graphics = { 22 - enable = cfg.withOpenGL; 23 - enable32Bit = cfg.withOpenGL; 24 - }; 25 - services.xserver.videoDrivers = [ "nvidia" ]; 26 - hardware.nvidia = { 27 - package = config.boot.kernelPackages.nvidiaPackages.latest; 28 - modesetting.enable = true; 29 - powerManagement.enable = false; 30 - powerManagement.finegrained = false; 31 - open = false; 32 - nvidiaSettings = true; 33 - }; 34 - }); 35 - }
-22
modules/nixos/programs/steam.nix
··· 1 - { config, pkgs, lib, ... }: 2 - let 3 - cfg = config.asgard.programs.steam; 4 - in 5 - { 6 - options.asgard.programs.steam = { 7 - enable = lib.mkEnableOption '' 8 - Enable an opiniated configuration for Steam. 9 - This is a basic steam configuration at the moment, this will be change in the future for optimization and console like experience. 10 - ''; 11 - }; 12 - 13 - config = lib.mkIf cfg.enable ({ 14 - programs.steam = { 15 - enable = true; 16 - gamescopeSession.enable = true; 17 - }; 18 - environment.sessionVariables = { 19 - STEAM_EXTRA_COMPAT_TOOS_PATHS = "/home/cosmeak/.steam/root/compatibilitytools.d"; 20 - }; 21 - }); 22 - }
-13
modules/nixos/suites/gaming.nix
··· 1 - { config, pkgs, lib, ... }: 2 - let 3 - cfg = config.asgard.suites.gaming; 4 - in 5 - { 6 - options.asgard.suites.gaming = { 7 - enable = lib.mkEnableOption "Enable the gaming suite."; 8 - }; 9 - 10 - config = lib.mkIf cfg.enable ({ 11 - # TODO 12 - }); 13 - }
-27
modules/nixos/system/auto-update.nix
··· 1 - { config, pkgs, lib, ... }: 2 - let 3 - cfg = config.asgard.system.autoUpdate; 4 - in 5 - { 6 - options.asgard.system.autoUpdate = { 7 - enable = lib.mkEnableOption "Enable system auto update."; 8 - }; 9 - 10 - config = lib.mkIf cfg.enable ({ 11 - # TODO: review this to make it work with auto turn on, update, 12 - # commit, push and then shutdown. 13 - 14 - # system.autoUpgrade = { 15 - # enable = true; 16 - # flake = "/etc/nixos\\?submodules=1"; 17 - # flags = [ 18 - # "--update-input" 19 - # "nixpkgs" 20 - # "-L" 21 - # ]; 22 - # dates = "Sat *-*-* 06:00:00"; 23 - # randomizedDelaySec = "45min"; 24 - # allowReboot = true; 25 - # }; 26 - }); 27 - }
overlays/.gitkeep

This is a binary file and will not be displayed.

packages/.gitkeep

This is a binary file and will not be displayed.

templates/.gitkeep

This is a binary file and will not be displayed.

-15
users/ben/andhrimnir/default.nix
··· 1 - { inputs, pkgs, ...}: 2 - { 3 - users.users."ben" = { 4 - isNormalUser = true; 5 - extraGroups = [ "wheel" ]; 6 - 7 - # User wide packages 8 - packages = with pkgs; [ 9 - spotify 10 - vesktop 11 - vscode 12 - lutris 13 - ]; 14 - }; 15 - }
-4
users/cosmeak/common/default.nix
··· 1 - { inputs, pkgs, ...}: 2 - { 3 - 4 - }
-21
users/cosmeak/loki/default.nix
··· 1 - { inputs, pkgs, ...}: 2 - { 3 - imports = [ ../common ]; 4 - 5 - users.users."cosmeak" = { 6 - isNormalUser = true; 7 - description = "cosmeak"; 8 - extraGroups = [ "networkmanager" "wheel" ]; 9 - 10 - # User wide packages 11 - packages = with pkgs; [ 12 - discord 13 - obs-studio 14 - prismlauncher 15 - obsidian 16 - spotify 17 - _1password-gui 18 - vesktop 19 - ]; 20 - }; 21 - }