Nixfiles! :3
0

Configure Feed

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

Will I now be able to add other machines as well :eyes:


Signed-off-by: MLC Bloeiman <mar@strawmelonjuice.com>

MLC Bloeiman (May 18, 2026, 3:52 PM +0200) b2e0f731 d54d19ea

+68 -20
+21 -5
README.md
··· 1 + I mainly keep this readme for myself, but if you're trying to adopt my dotfiles and stuck somewhere, contact me! You should be able to find my details on <https://strawmelonjuice.com/me/links>. 2 + 1 3 ### 1. Clone the repo 2 4 3 5 Cloning the `nix` branch using `jj` from my Tangled knot: ··· 16 18 jj git clone https://github.com/D3Ext/aesthetic-wallpapers.git ~/.local/share/wallpapers/aesthetic-wallpapers 17 19 ``` 18 20 19 - 2. Initialize a new Host if this is a brand new device: 21 + ### 2. Initialize a new Host (optional, if this is a brand new device) 22 + 20 23 ```bash 21 24 mkdir -p hosts/$(hostname) # Create the folder 22 25 cp /etc/nixos/*.nix ./hosts/$(hostname)/ # Copy installer configs 23 - nano ./flake.nix # Include the new defineSystem-entry in the nixosConfigurations block. 26 + nano ./flake.nix # Include the new defineSystem/defineHome-entry in the nixosConfigurations block. 24 27 nano ./hosts/$(hostname)/configuration.nix # You may want to tweak this, or maybe import `../all-hosts.nix`! 25 28 echo "{}" > ./home/host-specific/$(hostname).nix # For home-manager per-machine config 26 29 ``` 30 + 27 31 Otherwise make sure the hostname matches the one before and continue to 3! 28 32 29 - 3. Deploy 33 + If it is a new device, but not running NixOS, you'll have to only create the `defineHome` and home-manager-per-machine config. 34 + 35 + ### 3. Deploy 36 + 37 + #### For NixOS 30 38 ```Bash 31 39 jj # Capture new files so the flake can see them 32 40 sudo nixos-rebuild switch --flake .#$(hostname) # Apply based on current hostname ··· 36 44 doas git config --global --add safe.directory /home/mar/.dotfiles # Safelist dotfiles for root, so doas can be used to rebuild! 37 45 ``` 38 46 47 + 48 + #### For Home Manager Standalone (Non-NixOS or User-only) 49 + ```Bash 50 + jj # Capture new files 51 + nix run home-manager -- switch --flake .#$(hostname) 52 + ``` 53 + 54 + 55 + 39 56 ## Structure 40 57 41 58 | Directory | For | ··· 44 61 | `home/*` | Shared user environment and config | 45 62 | `configs/*` | Configuration files symlinked into their programs for when configuration is too advanced for `home/` | 46 63 | `fonts/*` | Fonts, imported by `home/modules/fonts.nix` | 47 - | `libs` | Bad habits. Libraries unavailable on nixpkgs and I was apparently too lazy to make an input out of them. | 48 64 49 65 ## Hosts currently known 50 66 ··· 53 69 | [Fennekin](https://pokemondb.net/pokedex/fennekin) | Convertible laptop (fire) | My take-with-me and drawing laptop, has a nice stylus tew | Touchscreen, convertible, wifi adaptor is busted, so there's an external one. | 54 70 | [Ponyta](https://pokemondb.net/pokedex/ponyta) | Laptop (fire) | My most beefiest laptop eva! And I use it mainly as my school laptop. | Has a good graphics card. Bigger screen. | 55 71 | [Samurott](https://pokemondb.net/pokedex/samurott) | Desktop PC (water) | - | Ultrawide screen, dual boots windows for games. | 72 + | [Cubchoo](https://pokemondb.net/pokedex/cubchoo) | Server (ice) | Also known as `marpi5-1` or `strawmelonservices`! | Lives in a hamster cage | 56 73 | [frigometri (german version of Cryogonal, symbolising server location)](https://pokemondb.net/pokedex/cryogonal) | Server (ice) | Cool server from friend I can use | 57 -
+46 -15
flake.nix
··· 46 46 }@inputs: 47 47 let 48 48 49 + # Helper function to get home modules 50 + getHomeModules = 51 + hostname: is_workstation: 52 + ( 53 + if is_workstation then 54 + [ 55 + ./home/desktop.nix 56 + ./home/cli.nix 57 + ] 58 + else 59 + [ 60 + ./home/cli.nix 61 + ] 62 + ) 63 + ++ [ 64 + ./home/host-specific/${hostname}.nix 65 + ]; 66 + 49 67 # Helper function to create system configs easily 50 68 defineSystem = 51 69 hostname: architecture: is_workstation: ··· 62 80 63 81 home-manager.extraSpecialArgs = { inherit inputs hostname; }; 64 82 home-manager.users.mar = { 65 - imports = 66 - ( 67 - if is_workstation then 68 - [ 69 - ./home/desktop.nix 70 - ./home/cli.nix 71 - ] 72 - else 73 - [ 74 - ./home/cli.nix 75 - ] 76 - ) 77 - ++ [ 78 - ./home/host-specific/${hostname}.nix 79 - ]; 83 + imports = getHomeModules hostname is_workstation; 80 84 }; 81 85 } 82 86 ]; 83 87 }; 88 + 89 + # Helper function for standalone Home Manager 90 + defineHome = 91 + hostname: architecture: is_workstation: 92 + home-manager.lib.homeManagerConfiguration { 93 + pkgs = import nixpkgs { 94 + system = architecture; 95 + config = { 96 + allowUnfreePackages = [ 97 + "joypixels" 98 + ]; 99 + joypixels.acceptLicense = true; 100 + allowUnfree = true; 101 + }; 102 + 103 + }; 104 + extraSpecialArgs = { inherit inputs hostname; }; 105 + modules = getHomeModules hostname is_workstation; 106 + }; 84 107 in 85 108 { 86 109 nixosConfigurations = { ··· 88 111 Samurott = (defineSystem "Samurott" "x86_64-linux" true); 89 112 Ponyta = (defineSystem "Ponyta" "x86_64-linux" true); 90 113 frigometri = (defineSystem "frigometri" "x86_64-linux" false); 114 + }; 115 + 116 + homeConfigurations = { 117 + Fennekin = (defineHome "Fennekin" "x86_64-linux" true); 118 + Samurott = (defineHome "Samurott" "x86_64-linux" true); 119 + Ponyta = (defineHome "Ponyta" "x86_64-linux" true); 120 + frigometri = (defineHome "frigometri" "x86_64-linux" false); 121 + marpi5-1 = (defineHome "Cubchoo" "aarch64-linux" false); 91 122 }; 92 123 }; 93 124 }
+1
home/host-specific/Cubchoo.nix
··· 1 + { }