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 darwin dock and remove dead files

Dead files are old configurations used as a base

cosmeak e59c2f62 9b291f5a

+8 -433
-7
README.md
··· 54 54 - 👹️ : FreeBSD with NixBSD 55 55 </details> 56 56 57 - <br> 58 - 59 - > [!NOTE] 60 - > hvedrung host is the same desktop as loki, just another SSD used or is used inside a VM. 61 - 62 - > [!NOTE] 63 - > The i5 is the worst CPU i've got, so much problem with stability and other things, some patch applied can be link for it stability. 64 57 65 58 ## 📦 - Structure 66 59
-217
hosts/loki/old-configuration.nix
··· 1 - # Edit this configuration file to define what should be installed on 2 - # your system. Help is available in the configuration.nix(5) man page 3 - # and in the NixOS manual (accessible by running ‘nixos-help’). 4 - 5 - { config, pkgs, ... }: 6 - { 7 - imports = 8 - [ # Include the results of the hardware scan. 9 - ./hardware-configuration.nix 10 - ]; 11 - 12 - # Bootloader. 13 - boot.loader.systemd-boot.enable = true; 14 - boot.loader.efi.canTouchEfiVariables = true; 15 - 16 - networking.hostName = "loki"; # Define your hostname. 17 - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 18 - 19 - # Configure network proxy if necessary 20 - # networking.proxy.default = "http://user:password@proxy:port/"; 21 - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 22 - 23 - # Enable networking 24 - networking.networkmanager.enable = true; 25 - 26 - # Set your time zone. 27 - time.timeZone = "Europe/Paris"; 28 - 29 - # Select internationalisation properties. 30 - i18n.defaultLocale = "en_US.UTF-8"; 31 - 32 - i18n.extraLocaleSettings = { 33 - LC_ADDRESS = "fr_FR.UTF-8"; 34 - LC_IDENTIFICATION = "fr_FR.UTF-8"; 35 - LC_MEASUREMENT = "fr_FR.UTF-8"; 36 - LC_MONETARY = "fr_FR.UTF-8"; 37 - LC_NAME = "fr_FR.UTF-8"; 38 - LC_NUMERIC = "fr_FR.UTF-8"; 39 - LC_PAPER = "fr_FR.UTF-8"; 40 - LC_TELEPHONE = "fr_FR.UTF-8"; 41 - LC_TIME = "fr_FR.UTF-8"; 42 - }; 43 - 44 - # Enable the X11 windowing system. 45 - services.xserver.enable = true; 46 - 47 - # Enable the GNOME Desktop Environment. 48 - # services.xserver.displayManager.gdm.enable = true; 49 - # services.xserver.desktopManager.gnome.enable = true; 50 - 51 - # Enable KDE Plasma Desktop Environment 52 - # services.displayManager.sddm.enable = true; 53 - # services.desktopManager.plasma6.enable = true; 54 - # services.displayManager.defaultSession = "plasma"; 55 - 56 - # Enable Budgie Desktop Environment 57 - services.xserver.desktopManager.budgie.enable = true; 58 - services.xserver.displayManager.lightdm.enable = true; 59 - 60 - # Configure keymap in X11 61 - services.xserver.xkb = { 62 - layout = "us"; 63 - variant = ""; 64 - }; 65 - 66 - # Enable CUPS to print documents. 67 - services.printing.enable = true; 68 - 69 - # Enable sound with pipewire. 70 - hardware.pulseaudio.enable = false; 71 - security.rtkit.enable = true; 72 - services.pipewire = { 73 - enable = true; 74 - alsa.enable = true; 75 - alsa.support32Bit = true; 76 - pulse.enable = true; 77 - # If you want to use JACK applications, uncomment this 78 - #jack.enable = true; 79 - 80 - # use the example session manager (no others are packaged yet so this is enabled by default, 81 - # no need to redefine it in your config for now) 82 - #media-session.enable = true; 83 - }; 84 - 85 - # Enable touchpad support (enabled default in most desktopManager). 86 - # services.xserver.libinput.enable = true; 87 - 88 - # Define a user account. Don't forget to set a password with ‘passwd’. 89 - users.users.cosmeak = { 90 - isNormalUser = true; 91 - description = "cosmeak"; 92 - extraGroups = [ "networkmanager" "wheel" ]; 93 - packages = with pkgs; [ 94 - # thunderbird 95 - # vscode 96 - ]; 97 - }; 98 - 99 - # Enable automatic login for the user. 100 - services.displayManager.autoLogin.enable = true; 101 - services.displayManager.autoLogin.user = "cosmeak"; 102 - 103 - # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 104 - systemd.services."getty@tty1".enable = false; 105 - systemd.services."autovt@tty1".enable = false; 106 - 107 - # Install firefox. 108 - programs.firefox.enable = true; 109 - 110 - # Allow unfree packages 111 - # Need to be true for nvidia drivers 112 - nixpkgs.config.allowUnfree = true; 113 - nixpkgs.config.allowBroken = true; 114 - 115 - # List packages installed in system profile. To search, run: 116 - # $ nix search wget 117 - # environment.systemPackages = with pkgs; [ 118 - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. 119 - # wget 120 - # ]; 121 - 122 - # Some programs need SUID wrappers, can be configured further or are 123 - # started in user sessions. 124 - # programs.mtr.enable = true; 125 - # programs.gnupg.agent = { 126 - # enable = true; 127 - # enableSSHSupport = true; 128 - # }; 129 - 130 - # List services that you want to enable: 131 - 132 - # Enable the OpenSSH daemon. 133 - # services.openssh.enable = true; 134 - 135 - # Open ports in the firewall. 136 - # networking.firewall.allowedTCPPorts = [ ... ]; 137 - # networking.firewall.allowedUDPPorts = [ ... ]; 138 - # Or disable the firewall altogether. 139 - # networking.firewall.enable = false; 140 - 141 - # This value determines the NixOS release from which the default 142 - # settings for stateful data, like file locations and database versions 143 - # on your system were taken. It‘s perfectly fine and recommended to leave 144 - # this value at the release version of the first install of this system. 145 - # Before changing this value read the documentation for this option 146 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 147 - system.stateVersion = "24.05"; # Did you read the comment? 148 - 149 - # -- This section refer to the NixOS/NVIDIA documentation 150 - # Enable OpenGL 151 - hardware.opengl = { 152 - enable = true; 153 - driSupport = true; 154 - driSupport32Bit = true; 155 - }; 156 - 157 - # Manage NVIDIA configuration 158 - services.xserver.videoDrivers = [ "nvidia" ]; 159 - hardware.nvidia = { 160 - package = config.boot.kernelPackages.nvidiaPackages.production; 161 - modesetting.enable = true; 162 - powerManagement.enable = false; 163 - powerManagement.finegrained = false; 164 - open = false; 165 - nvidiaSettings = true; 166 - }; 167 - # -- 168 - 169 - # -- Manage gaming 170 - programs.steam = { 171 - enable = true; 172 - gamescopeSession.enable = true; 173 - }; 174 - 175 - programs.gamemode.enable = true; 176 - 177 - environment.systemPackages = [ 178 - pkgs.git 179 - pkgs.vscode 180 - pkgs.mangohud 181 - pkgs.protonup 182 - pkgs.discord 183 - pkgs.modrinth-app 184 - pkgs.kitty 185 - pkgs.spotify 186 - pkgs.brave 187 - pkgs.lutris 188 - ]; 189 - 190 - environment.sessionVariables = { 191 - STEAM_EXTRA_COMPAT_TOOS_PATHS = "/home/cosmeak/.steam/root/compatibilitytools.d"; 192 - }; 193 - # -- 194 - 195 - # -- Manage Garbage collection 196 - # Limit the number of generations to keep 197 - boot.loader.systemd-boot.configurationLimit = 5; 198 - boot.loader.grub.configurationLimit = 5; 199 - 200 - # Perform garbage collection weekly to maintain low disk usage 201 - nix.gc = { 202 - automatic = true; 203 - dates = "weekly"; 204 - options = "--delete-older-than 1w"; 205 - }; 206 - 207 - # Optimize storage 208 - # You can also manually optimize the store via: 209 - # nix-store --optimise 210 - # Refer to the following link for more details: 211 - # https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store 212 - nix.settings.auto-optimise-store = true; 213 - # -- 214 - 215 - # Enable flakes 216 - nix.settings.experimental-features = [ "nix-command" "flakes" ]; 217 - }
+8 -1
hosts/njord/configuration.nix
··· 27 27 }; 28 28 system.defaults = { 29 29 # Dock 30 + # -- Relaunch dock when it not reload itself correctly 31 + # $ killall Dock 30 32 dock = { 31 - autohide = true; 33 + autohide = true; 32 34 orientation = "bottom"; # Set dock to bottom 33 35 mru-spaces = false; # Auto arrange space based on the most recent use 34 36 launchanim = false; # Remove animation when opening an app ··· 48 50 "/Applications/Zed.app" 49 51 "/Applications/Beekeeper Studio.app" 50 52 ]; 53 + # Disable hot corners 54 + wvous-bl-corner = 1; 55 + wvous-br-corner = 1; 56 + wvous-tl-corner = 1; 57 + wvous-tr-corner = 1; 51 58 }; 52 59 53 60 # Finder
-208
hosts/njord/old-flake.nix
··· 1 - { 2 - description = "Nix config for MacOS"; 3 - 4 - inputs = { 5 - # nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 6 - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; 7 - 8 - darwin = { 9 - url = "github:LnL7/nix-darwin"; 10 - inputs.nixpkgs.follows= "nixpkgs"; 11 - }; 12 - }; 13 - 14 - outputs = inputs @ { self, nixpkgs, darwin, home-manager, ... }: 15 - let 16 - system = "aarch64-darwin"; 17 - hostname = "njord"; 18 - 19 - specialArgs = inputs // { inherit hostname; }; 20 - 21 - configuration = { pkgs, ... }: { nixpkgs.config = { 22 - allowUnfree = true; 23 - allowInsecure = false; 24 - allowBroken = true; 25 - allowUnsupportedSystem = true; 26 - }; 27 - # List packages installed in system profile. To search by name, run: 28 - # $ nix-env -qaP | grep wget 29 - environment.systemPackages = 30 - [ 31 - # Dev 32 - pkgs.neovim 33 - pkgs.kitty 34 - pkgs.vscode 35 - 36 - pkgs.php 37 - pkgs.phpPackages.composer 38 - pkgs.nodejs 39 - 40 - # CLI 41 - pkgs.starship 42 - pkgs.zoxide 43 - pkgs.tree 44 - pkgs.btop 45 - pkgs.lazygit 46 - pkgs.ngrok 47 - pkgs.fastfetch 48 - 49 - # Apps 50 - pkgs.spicetify-cli 51 - 52 - # Utilities 53 - pkgs.alt-tab-macos 54 - pkgs.raycast 55 - ]; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; # nix.package = pkgs.nix; 56 - # Create /etc/zshrc that loads the darwin environment. 57 - programs.zsh = { 58 - enable = true; 59 - enableBashCompletion = true; 60 - enableCompletion = true; 61 - enableSyntaxHighlighting = true; 62 - loginShellInit = '' 63 - eval "$(zoxide init zsh)" 64 - eval "$(/opt/homebrew/bin/brew shellenv)" 65 - alias switch="darwin-rebuild switch --flake ~/.config/nix-darwin" 66 - ''; 67 - }; 68 - 69 - # Set Git commit hash for darwin-version. 70 - system.configurationRevision = self.rev or self.dirtyRev or null; 71 - 72 - # Used for backwards compatibility, please read the changelog before changing. 73 - # $ darwin-rebuild changelog 74 - system.stateVersion = 4; 75 - 76 - # The platform the configuration will be used on. 77 - nixpkgs.hostPlatform = "aarch64-darwin"; 78 - 79 - # Enable sudo via TouchID 80 - security.pam.enableSudoTouchIdAuth = true; 81 - 82 - # Config Macos with preference 83 - # Disable startup sound 84 - system.nvram.variables = { 85 - "StartupMute" = "%01"; 86 - }; 87 - system.defaults = { 88 - # Dock 89 - dock = { 90 - autohide = true; 91 - orientation = "bottom"; # Set dock to bottom 92 - mru-spaces = false; # Auto arrange space based on the most recent use 93 - launchanim = false; # Remove animation when opening an app 94 - mineffect = "scale"; # Change animation from minimize/maximize app 95 - magnification = false; 96 - minimize-to-application = true; # Minimize app in app icon 97 - show-recents = false; # Don't show recent open apps 98 - tilesize = 32; # Set dock size 99 - # Set dock apps 100 - persistent-apps = [ 101 - "/Applications/Thunderbird.app" 102 - "/Applications/Brave Browser.app" 103 - "/Applications/Discord.app" 104 - "/Applications/Spotify.app" 105 - "/Applications/Obsidian.app" 106 - "/Applications/Nix Apps/kitty.app" 107 - "/Applications/Zed.app" 108 - "/Applications/Beekeeper Studio.app" 109 - ]; 110 - }; 111 - 112 - # Finder 113 - finder = { 114 - AppleShowAllExtensions = true; # Show file extension 115 - AppleShowAllFiles = true; # Show hidden files 116 - FXPreferredViewStyle = "clmv"; # Set default view to column 117 - CreateDesktop = false; # Disable show icon on desktop 118 - FXDefaultSearchScope = "SCcf"; # Set default search scope to current folder 119 - }; 120 - 121 - # Screenshot 122 - screencapture.location = "~/Pictures/screenshots"; 123 - 124 - NSGlobalDomain = { 125 - # Switch between dark and light mode automatically 126 - AppleInterfaceStyleSwitchesAutomatically = true; 127 - # Disable saving new documents to icloud 128 - NSDocumentSaveNewDocumentsToCloud = false; 129 - }; 130 - 131 - }; 132 - 133 - # Homebrew - Using only for gui app because macos app do not existe un nixpkgs repository 134 - homebrew.enable = true; 135 - homebrew.onActivation = { 136 - autoUpdate = true; 137 - cleanup = "zap"; # uninstall all elements not listed below 138 - }; 139 - homebrew.taps = [ 140 - "homebrew/cask-versions" 141 - "homebrew/cask-fonts" 142 - "FelixKratz/formulae" 143 - ]; 144 - 145 - homebrew.brews = [ 146 - "cocoapods" 147 - "yarn" 148 - ]; 149 - 150 - homebrew.casks = [ 151 - # Dev 152 - "zed" 153 - "beekeeper-studio" 154 - "insomnia" 155 - "orbstack" 156 - "figma" 157 - "dbngin" 158 - "github" 159 - "mongodb-compass" 160 - "cyberduck" 161 - 162 - # Apps 163 - "spotify" 164 - "discord" 165 - "thunderbird" 166 - "obs" 167 - "obsidian" 168 - "modrinth" 169 - "zen-browser" 170 - "brave-browser" 171 - "balenaetcher" 172 - 173 - # Utilities 174 - "amethyst" 175 - # "sketchybar" 176 - "stats" 177 - "logi-options-plus" 178 - 179 - # Fonts 180 - "sf-symbols" 181 - "font-hack-nerd-font" 182 - ]; 183 - 184 - # Apps from App Store@ 185 - homebrew.masApps = { 186 - # Xcode = 497799835; 187 - Slack = 803453959; 188 - }; 189 - }; 190 - in 191 - { 192 - darwinConfigurations."${hostname}" = darwin.lib.darwinSystem { 193 - inherit system specialArgs; 194 - modules = [ configuration ]; 195 - }; 196 - 197 - # Nix code formatter 198 - formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; 199 - 200 - # Expose the package set, including overlays, for convenience. 201 - darwinPackages = self.darwinConfigurations."${hostname}".pkgs; 202 - }; 203 - } 204 - 205 - # Rebuild system with 206 - # darwin-rebuild switch --flake . 207 - # Relaunch dock 208 - # killall Dock