add bootloader modules
This commit is contained in:
parent
1e7c0f2c45
commit
9b44ab530b
9 changed files with 251 additions and 16 deletions
158
flake.lock
generated
158
flake.lock
generated
|
@ -56,6 +56,33 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"chaotic": {
|
||||||
|
"inputs": {
|
||||||
|
"fenix": "fenix",
|
||||||
|
"flake-schemas": "flake-schemas",
|
||||||
|
"home-manager": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"jovian": "jovian",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1739799871,
|
||||||
|
"narHash": "sha256-Nn5RQDvl+pK0V1sn5R88j1cyqm81VFO9zxHGYk0YIBo=",
|
||||||
|
"owner": "chaotic-cx",
|
||||||
|
"repo": "nyx",
|
||||||
|
"rev": "f450c658f012cdf93fc4d0e85a208a23a27efadb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "chaotic-cx",
|
||||||
|
"ref": "nyxpkgs-unstable",
|
||||||
|
"repo": "nyx",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"darwin": {
|
"darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -115,6 +142,28 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"chaotic",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1739687593,
|
||||||
|
"narHash": "sha256-K7+n5+W2OrqEjeVb4422YxwNw1m4lCfnd+QWCnm+Dgs=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"rev": "a712b739a49e10fe73de366a42a43b2714e41bfc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -167,6 +216,20 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-schemas": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721999734,
|
||||||
|
"narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=",
|
||||||
|
"rev": "0a5c42297d870156d9c57d8f99e476b738dcd982",
|
||||||
|
"revCount": 75,
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_4"
|
"systems": "systems_4"
|
||||||
|
@ -230,11 +293,11 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739664099,
|
"lastModified": 1739814478,
|
||||||
"narHash": "sha256-oILseXulxU+QsyuUxOvC3/rQoIvnVMBnpAUKI/A+bnk=",
|
"narHash": "sha256-y/O5nx9yZq3IAmFIQ0HR8a91o9Q0HT6MrrmZwfQU2gI=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "2b7d75e0fc8b4b6760d350947bc5e476633cf751",
|
"rev": "d882f4a1e850c936d58fb9794416c9ab31fb5257",
|
||||||
"revCount": 67,
|
"revCount": 71,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.blahai.gay/blahai/haipkgs.git"
|
"url": "https://git.blahai.gay/blahai/haipkgs.git"
|
||||||
},
|
},
|
||||||
|
@ -271,11 +334,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739676861,
|
"lastModified": 1739802995,
|
||||||
"narHash": "sha256-X86ptHMNVuu1Z9leL0YV2E/oxD2IgPYrYANPcvFYpNo=",
|
"narHash": "sha256-kZv0upOigS/4sUEgZuZd6/uO6s8X8oYOLk9/sGMsl+c=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "eb44c1601ed99896525e983bc9b15eb8b4d5879e",
|
"rev": "9d0d48f4c3d2fb1a8c8607da143bb567a741d914",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -360,11 +423,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739665242,
|
"lastModified": 1739757807,
|
||||||
"narHash": "sha256-iY4DtNDebYHt0uuN0EWWeNQ8K/SYix8KeUe2tcFzW0A=",
|
"narHash": "sha256-HYaYpFFCopski3zyKDp/XTARlkwCkSHvfWBoCAcbqkk=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "897ee276dc0a8a6b11a8102b225a9e969faac0bf",
|
"rev": "59c615c321c45302491de3b1c003844c86aefca7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -545,6 +608,28 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"jovian": {
|
||||||
|
"inputs": {
|
||||||
|
"nix-github-actions": "nix-github-actions",
|
||||||
|
"nixpkgs": [
|
||||||
|
"chaotic",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1739640234,
|
||||||
|
"narHash": "sha256-+o3AWAC0GICcvdn+vXGmQ5hXJSALdD3rgnt+SZLRQKU=",
|
||||||
|
"owner": "Jovian-Experiments",
|
||||||
|
"repo": "Jovian-NixOS",
|
||||||
|
"rev": "dc10b4ba56665c66562a5e993c9734fe89c29c65",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Jovian-Experiments",
|
||||||
|
"repo": "Jovian-NixOS",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -580,13 +665,36 @@
|
||||||
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz"
|
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-github-actions": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"chaotic",
|
||||||
|
"jovian",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1729697500,
|
||||||
|
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"repo": "nix-github-actions",
|
||||||
|
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"ref": "matrix-name",
|
||||||
|
"repo": "nix-github-actions",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739446958,
|
"lastModified": 1739736696,
|
||||||
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
|
"narHash": "sha256-zON2GNBkzsIyALlOCFiEBcIjI4w38GYOb+P+R4S8Jsw=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
|
"rev": "d74a2335ac9c133d6bbec9fc98d91a77f1604c1f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -622,6 +730,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
|
"chaotic": "chaotic",
|
||||||
"deploy-rs": "deploy-rs",
|
"deploy-rs": "deploy-rs",
|
||||||
"easy-hosts": "easy-hosts",
|
"easy-hosts": "easy-hosts",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
|
@ -633,6 +742,23 @@
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-analyzer-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1739512757,
|
||||||
|
"narHash": "sha256-QfmtsyySvQSEKLuB850AmyqpNQRP+T57vuZnGIpmGD4=",
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"rev": "40e4f9130f4e44f20961a7cf4ade46325126698b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"ref": "nightly",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -641,11 +767,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739586408,
|
"lastModified": 1739673031,
|
||||||
"narHash": "sha256-UN9hRKRE1eLU8C0cioTZubaCZQTA8NDc8/4vCpS5pS0=",
|
"narHash": "sha256-Z/GT8ebbvc4goxN4A0A5ACj26G1HaGJO+VetrPuC5Mo=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "3dbc0ce1c0690b83cfb9a9a51fbe90c3bc8f9916",
|
"rev": "538528d55318e0c8af1c307dcf10b7629b988fc3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
url = "git+https://git.blahai.gay/blahai/haipkgs.git";
|
url = "git+https://git.blahai.gay/blahai/haipkgs.git";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.follows = "nixpkgs";
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
# Will add more follows if needed
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,6 +23,14 @@
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
chaotic = {
|
||||||
|
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
home-manager.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
5
modules/nixos/boot/default.nix
Normal file
5
modules/nixos/boot/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./loader
|
||||||
|
];
|
||||||
|
}
|
21
modules/nixos/boot/loader/default.nix
Normal file
21
modules/nixos/boot/loader/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) enum;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./systemd-boot.nix
|
||||||
|
./grub.nix
|
||||||
|
./refind.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.olympus.system.boot.loader = mkOption {
|
||||||
|
type = enum [
|
||||||
|
"none"
|
||||||
|
"grub"
|
||||||
|
"systemd-boot"
|
||||||
|
"refind"
|
||||||
|
];
|
||||||
|
default = "none";
|
||||||
|
description = "The bootloader";
|
||||||
|
};
|
||||||
|
}
|
31
modules/nixos/boot/loader/grub.nix
Normal file
31
modules/nixos/boot/loader/grub.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) nullOr str;
|
||||||
|
cfg = config.olympus.system.boot;
|
||||||
|
in {
|
||||||
|
options.olympus.system.boot.grub = {
|
||||||
|
device = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = "nodev";
|
||||||
|
description = "The device to install the bootloader to.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.loader == "grub") {
|
||||||
|
boot.loader.grub = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
useOSProber = false;
|
||||||
|
efiSupport = false;
|
||||||
|
enableCryptodisk = mkDefault false;
|
||||||
|
inherit (cfg.grub) device;
|
||||||
|
theme = null;
|
||||||
|
backgroundColor = null;
|
||||||
|
splashImage = null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
18
modules/nixos/boot/loader/refind.nix
Normal file
18
modules/nixos/boot/loader/refind.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
|
|
||||||
|
cfg = config.olympus.system.boot;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.loader == "refind") {
|
||||||
|
boot.loader.refind = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
maxGenerations = 5;
|
||||||
|
extraConfig = ''
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
18
modules/nixos/boot/loader/systemd-boot.nix
Normal file
18
modules/nixos/boot/loader/systemd-boot.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
|
|
||||||
|
cfg = config.olympus.system.boot;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.loader == "systemd-boot") {
|
||||||
|
boot.loader.systemd-boot = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
configurationLimit = 5;
|
||||||
|
consoleMode = "max";
|
||||||
|
editor = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./remote-modules.nix
|
./remote-modules.nix
|
||||||
|
./boot
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
{inputs, ...}: {
|
{inputs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
|
# Fork of nix
|
||||||
|
inputs.lix-module.nixosModules.default
|
||||||
|
# My own modules like rEFInd for nixos
|
||||||
|
inputs.haipkgs.nixosModules.default
|
||||||
|
# Chaotic nyx stuff (mostly for chos kernel)
|
||||||
|
inputs.chaotic.nixosModules.default
|
||||||
# TODO replace with hjem once possible
|
# TODO replace with hjem once possible
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Reference in a new issue