From e3e4a05defe07c17bb18cbc94dad7e7e3b828fa2 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Tue, 7 Mar 2023 21:50:03 -0500 Subject: [PATCH] switched to disko on game-laptop --- flake.lock | 21 ++++++++++++++++++ flake.nix | 10 ++++++++- systems/game-laptop/default.nix | 19 +--------------- systems/game-laptop/disko.nix | 39 +++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 19 deletions(-) create mode 100644 systems/game-laptop/disko.nix diff --git a/flake.lock b/flake.lock index 353ebe8..b730f04 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1678067051, + "narHash": "sha256-0QN2lO6dp4OlEysqufuXEgW1QywANKCuF+6EsNXcZ7o=", + "owner": "nix-community", + "repo": "disko", + "rev": "cf705ee16161b29b0e18983ecd8df3cb50f66142", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "fetch-rs": { "inputs": { "flake-utils": "flake-utils", @@ -249,6 +269,7 @@ }, "root": { "inputs": { + "disko": "disko", "fetch-rs": "fetch-rs", "flake-utils": "flake-utils_2", "master": "master", diff --git a/flake.nix b/flake.nix index 35137e8..c2b5ac8 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,10 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "unstable"; }; - + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "unstable"; + }; #the-argus is awesome spicetify-nix = { url = "github:the-argus/spicetify-nix"; @@ -42,6 +45,7 @@ flake-utils, nvim-flake, nixos-generators, + disko, ... } @ inputs: { @@ -56,6 +60,7 @@ }; modules = [ + disko.nixosModules.disko (import ./modules inputs) (import ./systems/gerg-desktop inputs) { @@ -75,6 +80,7 @@ }; }; modules = [ + disko.nixosModules.disko (import ./modules inputs) (import ./systems/game-laptop inputs) ]; @@ -88,6 +94,7 @@ }; }; modules = [ + disko.nixosModules.disko (import ./modules inputs) (import ./systems/moms-laptop inputs) ]; @@ -96,6 +103,7 @@ system = "x86_64-linux"; specialArgs = {inherit self;}; modules = [ + disko.nixosModules.disko (import ./systems/notbuntu inputs) (import ./modules/nix.nix inputs) (import ./modules/unfree.nix inputs) diff --git a/systems/game-laptop/default.nix b/systems/game-laptop/default.nix index 5950c5a..02da4dd 100644 --- a/systems/game-laptop/default.nix +++ b/systems/game-laptop/default.nix @@ -7,6 +7,7 @@ inputs: { }: { imports = [ (import ./prime.nix inputs) + (import ./disko.nix inputs) (import ./gaming.nix inputs) ]; @@ -75,22 +76,4 @@ inputs: { kernelModules = ["kvm-amd"]; kernelPackages = pkgs.linuxPackages_zen; }; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/0822f37a-e55b-4b56-aeae-b6f4a11306c3"; - fsType = "ext4"; - label = "nixos"; - noCheck = false; - mountPoint = "/"; - neededForBoot = true; - }; - "/boot" = { - device = "/dev/disk/by-uuid/EA2C-E488"; - fsType = "vfat"; - label = "BOOT"; - noCheck = false; - mountPoint = "/boot"; - neededForBoot = true; - }; - }; } diff --git a/systems/game-laptop/disko.nix b/systems/game-laptop/disko.nix new file mode 100644 index 0000000..68ef73e --- /dev/null +++ b/systems/game-laptop/disko.nix @@ -0,0 +1,39 @@ +_: { + disko.devices = { + disk.nvme0n1 = { + device = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + name = "ESP"; + start = "1049KB"; + end = "538MB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "root"; + type = "partition"; + start = "538MB"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; + }; +}