Disko Flake Setup

- Add disko as input to flake
- Use diskoConfig flake variable to select disko configuration in configuration.nix
This commit is contained in:
Sravan Balaji
2024-03-24 10:23:57 -04:00
parent da7bcecacd
commit 7b9bafb13d
2 changed files with 8 additions and 5 deletions

View File

@@ -10,9 +10,12 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = inputs@{ self, nixpkgs, nixpkgs-stable, home-manager, stylix, ... }: outputs = inputs@{ self, nixpkgs, nixpkgs-stable, home-manager, stylix, disko, ... }:
let let
# --- SYSTEM SETTINGS --- # # --- SYSTEM SETTINGS --- #
systemSettings = { systemSettings = {
@@ -21,7 +24,7 @@
profile = "personal"; # Select a profile defined from profiles directory profile = "personal"; # Select a profile defined from profiles directory
timezone = "America/New_York"; # Time Zone timezone = "America/New_York"; # Time Zone
locale = "en_US.UTF-8"; # Locale locale = "en_US.UTF-8"; # Locale
diskoConfig = "luks-btrfs-subvolumes"; # Disko Partition Configuration diskoConfig = "luks-btrfs-subvolumes"; # Select the disko config that was used to partition drive
}; };
# --- USER SETTINGS --- # # --- USER SETTINGS --- #
@@ -86,6 +89,7 @@
system = systemSettings.system; system = systemSettings.system;
modules = [ modules = [
(./. + "/profiles" + ("/" + systemSettings.profile) + "/configuration.nix") (./. + "/profiles" + ("/" + systemSettings.profile) + "/configuration.nix")
disko.nixosModules.disko
]; ];
specialArgs = { specialArgs = {
inherit pkgs-stable; inherit pkgs-stable;

View File

@@ -7,8 +7,7 @@
{ {
imports = [ imports = [
../../system/hardware-configuration.nix ../../system/hardware-configuration.nix
"${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix" "../../disko/" + systemSettings.diskoConfig
"../../disko/${systemSettings.diskoConfiguration}.nix"
]; ];
nix = { nix = {
@@ -29,7 +28,7 @@
grub = { grub = {
enable = true; enable = true;
efiSupport = true; efiSupport = true;
device = "nodev"; efiInstallAsRemovable = true;
}; };
}; };
}; };