diff --git a/disko/btrfs-legacy.nix b/disko/btrfs-legacy.nix index a8f58e6..e3ad455 100644 --- a/disko/btrfs-legacy.nix +++ b/disko/btrfs-legacy.nix @@ -1,30 +1,34 @@ -{ device }: +{ mainDisk }: { - disk.main = { - type = "disk"; - inherit device; + disk.main = { + device = mainDisk; + type = "disk"; - content = { - type = "msdos"; - partitions = { - root = { - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "@root" = { mountpoint = "/"; }; - "@nix" = { mountpoint = "/nix"; }; - "@var" = { mountpoint = "/var"; }; - "@docker" = { mountpoint = "/var/lib/docker"; }; - "@home" = { mountpoint = "/home"; }; - "@snapshots" = { mountpoint = "/.snapshots"; }; + content = { + type = "gpt"; + partitions = { + MBR = { + size = "1M"; + type = "EF02"; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "@root" = { mountpoint = "/"; }; + "@nix" = { mountpoint = "/nix"; }; + "@var" = { mountpoint = "/var"; }; + "@docker" = { mountpoint = "/var/lib/docker"; }; + "@home" = { mountpoint = "/home"; }; + "@snapshots" = { mountpoint = "/.snapshots"; }; + }; + }; + }; }; - }; }; - }; }; - }; } diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9304492 --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "disko": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1766150702, + "narHash": "sha256-P0kM+5o+DKnB6raXgFEk3azw8Wqg5FL6wyl9jD+G5a4=", + "owner": "nix-community", + "repo": "disko", + "rev": "916506443ecd0d0b4a0f4cf9d40a3c22ce39b378", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1763618868, + "narHash": "sha256-v5afmLjn/uyD9EQuPBn7nZuaZVV9r+JerayK/4wvdWA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a8d610af3f1a5fb71e23e08434d8d61a466fc942", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1765838191, + "narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "disko": "disko", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 12bce91..c92d31b 100644 --- a/flake.nix +++ b/flake.nix @@ -6,11 +6,11 @@ disko.url = "github:nix-community/disko"; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, disko }: let system = "x86_64-linux"; release = "25.11"; - mainDisk = "/dev/sda"; + mainDisk = "/dev/sdc"; myUser = "victor"; in { nixosConfigurations = { @@ -18,7 +18,7 @@ inherit system; specialArgs = { inherit release mainDisk myUser; }; modules = [ - inputs.disko.nixosModules.disko + disko.nixosModules.disko ./hosts/isengard.nix ./modules/base.nix @@ -26,7 +26,7 @@ ({ ... }: { disko.devices = import ./disko/btrfs-legacy.nix { - device = mainDisk; + inherit mainDisk; }; }) ]; diff --git a/modules/base.nix b/modules/base.nix index 5710d9c..6ff6314 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -8,7 +8,6 @@ boot.loader.grub = { enable = true; - device = mainDisk; }; environment.systemPackages = with pkgs; [ diff --git a/modules/docker.nix b/modules/docker.nix index 5bb209a..eeee706 100644 --- a/modules/docker.nix +++ b/modules/docker.nix @@ -1,10 +1,13 @@ { config, myUser, ... }: { - virtualization.docker.rootless = { - enable = true; - setSocketVariable = true; + users.users.myUser.extraGroups = [ "docker" ]; + + virtualisation.docker = { storageDriver = "btrfs"; - users.users.myUser.extraGroups = [ "docker" ]; - } + rootless = { + enable = true; + setSocketVariable = true; + }; + }; }