this repo has no description
0
fork

Configure Feed

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

feat!: declarative disk partitioning with Disko

+74 -9
+11 -4
Makefile
··· 4 4 default: build 5 5 6 6 build: 7 - # TODO find a way to generate hardware configuration and avoid impure 8 7 sudo nixos-rebuild \ 9 - --impure \ 10 8 --flake '.#${host}' \ 11 9 switch 12 10 13 11 test: 14 12 nixos-rebuild \ 15 - --impure \ 16 13 --flake '.#testvm' \ 17 14 build-vm 18 15 ./result/bin/run-testvm-vm 19 16 20 17 diff: 21 18 nixos-rebuild \ 22 - --impure \ 23 19 --flake '.#${host}' \ 24 20 build 25 21 nix store diff-closures \ ··· 28 24 29 25 update: 30 26 nix flake update 27 + 28 + install: 29 + # This consumes significant memory on the live USB because dependencies are 30 + # downloaded to tmpfs. The configuration must be small, or the machine must 31 + # have a lot of RAM. 32 + sudo nix \ 33 + --extra-experimental-features 'nix-command flakes' \ 34 + run 'github:nix-community/disko/latest#disko-install' -- \ 35 + --write-efi-boot-entries \ 36 + --flake '.#${host}' \ 37 + --disk main '${device}'
+34 -4
configuration.nix
··· 1 1 { config, pkgs, ... }: 2 2 3 3 { 4 - imports = [ 5 - # TODO find a way to generate hardware configuration? 6 - /etc/nixos/hardware-configuration.nix 7 - ]; 4 + disko.devices = { 5 + disk = { 6 + main = { 7 + type = "disk"; 8 + content = { 9 + type = "gpt"; 10 + partitions = { 11 + boot = { 12 + size = "1M"; 13 + type = "EF02"; # for grub MBR 14 + }; 15 + ESP = { 16 + size = "1G"; 17 + type = "EF00"; 18 + content = { 19 + type = "filesystem"; 20 + format = "vfat"; 21 + mountpoint = "/boot"; 22 + mountOptions = [ "umask=0077" ]; 23 + }; 24 + }; 25 + root = { 26 + size = "100%"; 27 + content = { 28 + type = "filesystem"; 29 + format = "ext4"; 30 + mountpoint = "/"; 31 + }; 32 + }; 33 + }; 34 + }; 35 + }; 36 + }; 37 + }; 8 38 9 39 boot.loader.systemd-boot.enable = true; 10 40 boot.loader.efi.canTouchEfiVariables = true;
+21
flake.lock
··· 1 1 { 2 2 "nodes": { 3 + "disko": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ] 8 + }, 9 + "locked": { 10 + "lastModified": 1733168902, 11 + "narHash": "sha256-8dupm9GfK+BowGdQd7EHK5V61nneLfr9xR6sc5vtDi0=", 12 + "owner": "nix-community", 13 + "repo": "disko", 14 + "rev": "785c1e02c7e465375df971949b8dcbde9ec362e5", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "owner": "nix-community", 19 + "repo": "disko", 20 + "type": "github" 21 + } 22 + }, 3 23 "home-manager": { 4 24 "inputs": { 5 25 "nixpkgs": [ ··· 55 75 }, 56 76 "root": { 57 77 "inputs": { 78 + "disko": "disko", 58 79 "home-manager": "home-manager", 59 80 "nixos-hardware": "nixos-hardware", 60 81 "nixpkgs": "nixpkgs"
+6 -1
flake.nix
··· 5 5 nixpkgs = { 6 6 url = "github:nixos/nixpkgs/nixos-24.11"; 7 7 }; 8 + disko = { 9 + url = "github:nix-community/disko"; 10 + inputs.nixpkgs.follows = "nixpkgs"; 11 + }; 8 12 nixos-hardware = { 9 13 url = "github:NixOS/nixos-hardware/master"; 10 14 }; ··· 14 18 }; 15 19 }; 16 20 17 - outputs = { self, nixpkgs, nixos-hardware, home-manager }: { 21 + outputs = { self, nixpkgs, disko, nixos-hardware, home-manager }: { 18 22 nixosConfigurations = { 19 23 ryzentower = nixpkgs.lib.nixosSystem { 20 24 system = "x86_64-linux"; 21 25 modules = [ 26 + disko.nixosModules.disko 22 27 ./configuration.nix 23 28 home-manager.nixosModules.home-manager 24 29 ./users/khuedoan.nix
+2
hosts/ryzentower/default.nix
··· 1 1 { pkgs, ... }: 2 2 3 3 { 4 + disko.devices.disk.main.device = "/dev/sda"; 5 + 4 6 hardware = { 5 7 graphics = { 6 8 enable32Bit = true;