Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions configurations/nixos/example/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# NOTE: We expect this file to be supplanted by the original /etc/nixos/configuration.nix
{ lib, ... }:
{
# These are normally in hardware-configuration.nix
boot.loader.grub.device = "nodev";
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; fsType = "btrfs"; };
imports = [
./hardware-configuration.nix
];

nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
networking.hostName = "example";

# Used for backwards compatibility, please read the changelog before changing.
Expand Down
38 changes: 38 additions & 0 deletions configurations/nixos/example/disk-config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Disko config
{
disko.devices = {
disk = {
main = {
# When using disko-install, we will overwrite this value from the commandline
device = "/dev/disk/by-id/some-disk-id";
type = "disk";
content = {
type = "gpt";
partitions = {
MBR = {
type = "EF02"; # for grub MBR
size = "1M";
};
ESP = {
type = "EF00";
size = "500M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}
15 changes: 15 additions & 0 deletions configurations/nixos/example/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file pertains to the use of disko & disko-install.
#
# If you did manual NixOS install, you may want to replace this with your /etc/nixos/hardware-configuration.nix
{ flake, ... }:
{
imports = [
flake.inputs.disko.nixosModules.disko
./disk-config.nix
];

boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
}
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
flake-parts.url = "github:hercules-ci/flake-parts";
nixos-unified.url = "github:srid/nixos-unified";

# NixOS specific
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";

# Software inputs
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
Expand Down