nixberry: first viable build
This commit is contained in:
parent
0322c74f99
commit
d8cf6893e7
5 changed files with 48 additions and 45 deletions
17
flake.lock
generated
17
flake.lock
generated
|
|
@ -1386,6 +1386,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-rpi": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761934558,
|
||||||
|
"narHash": "sha256-0gB7tv25nPv+Vkr9YNi6gOEpX5cuDTnaTZlRNHZfgqA=",
|
||||||
|
"owner": "nvmd",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "791ec2ce5034ba9658e12ee4c33a001a38f5280a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nvmd",
|
||||||
|
"ref": "modules-with-keys-25.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1763622513,
|
"lastModified": 1763622513,
|
||||||
|
|
@ -1578,6 +1594,7 @@
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"nixpkgs-latest-factorio": "nixpkgs-latest-factorio",
|
"nixpkgs-latest-factorio": "nixpkgs-latest-factorio",
|
||||||
"nixpkgs-master": "nixpkgs-master",
|
"nixpkgs-master": "nixpkgs-master",
|
||||||
|
"nixpkgs-rpi": "nixpkgs-rpi",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"simple-nixos-mailserver": "simple-nixos-mailserver",
|
"simple-nixos-mailserver": "simple-nixos-mailserver",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi/main";
|
nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi/main";
|
||||||
############
|
nixpkgs-rpi.url = "github:nvmd/nixpkgs/modules-with-keys-25.05";
|
||||||
|
|
||||||
nix-gaming = {
|
nix-gaming = {
|
||||||
url = "github:fufexan/nix-gaming";
|
url = "github:fufexan/nix-gaming";
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@
|
||||||
"https://nixcache.christophhollizeck.dev"
|
"https://nixcache.christophhollizeck.dev"
|
||||||
"https://hyprland.cachix.org"
|
"https://hyprland.cachix.org"
|
||||||
"https://nix-gaming.cachix.org"
|
"https://nix-gaming.cachix.org"
|
||||||
|
"https://nixos-raspberrypi.cachix.org"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
||||||
|
|
@ -67,6 +68,7 @@
|
||||||
"christophhollizeck.dev:7pPAvm9xqFQB8FDApVNL6Tii1Jsv+Sj/LjEIkdeGhbA="
|
"christophhollizeck.dev:7pPAvm9xqFQB8FDApVNL6Tii1Jsv+Sj/LjEIkdeGhbA="
|
||||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||||
|
"nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
// (lib.optionalAttrs config.programs.direnv.enable {
|
// (lib.optionalAttrs config.programs.direnv.enable {
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,23 @@ in
|
||||||
(lib.mapAttrs' (
|
(lib.mapAttrs' (
|
||||||
name: module:
|
name: module:
|
||||||
let
|
let
|
||||||
|
raspberrypis = [ "nixberry" ];
|
||||||
|
|
||||||
|
stripped_name = lib.removePrefix prefix name;
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
hostConfig = module // {
|
hostConfig = module // {
|
||||||
name = lib.removePrefix prefix name;
|
name = stripped_name;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
raspberrypis = [ "nixberry" ];
|
nixos-raspberrypi = lib.mkIf (builtins.elem stripped_name raspberrypis) inputs.nixos-raspberrypi;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
name = lib.removePrefix prefix name;
|
name = stripped_name;
|
||||||
value =
|
value =
|
||||||
if builtins.elem name raspberrypis then
|
if builtins.elem stripped_name raspberrypis then
|
||||||
inputs.nixos-raspberrypi.lib.nixosSystem {
|
inputs.nixos-raspberrypi.lib.nixosSystem {
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
modules = module.imports ++ [
|
modules = module.imports ++ [
|
||||||
|
|
|
||||||
|
|
@ -6,53 +6,27 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.nixos."hosts/nixberry" =
|
flake.modules.nixos."hosts/nixberry" =
|
||||||
{ inputs, pkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
|
|
||||||
ipAddress = "192.168.178.2";
|
ipAddress = "192.168.178.2";
|
||||||
sopsFile = ../../../secrets/secrets-nixberry.yaml;
|
sopsFile = ../../../secrets/secrets-nixberry.yaml;
|
||||||
kernelBundle = pkgs.linuxAndFirmware.v6_6_31;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
hostPlatform = {
|
|
||||||
system = "aarch64-linux";
|
|
||||||
};
|
|
||||||
|
|
||||||
overlays = [
|
|
||||||
(self: super: {
|
|
||||||
inherit (kernelBundle) raspberrypiWirelessFirmware;
|
|
||||||
inherit (kernelBundle) raspberrypifw;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
|
||||||
loader.raspberryPi.firmwarePackage = kernelBundle.raspberrypifw;
|
|
||||||
loader.raspberryPi.bootloader = "kernel";
|
|
||||||
kernelPackages = kernelBundle.linuxPackages_rpi5;
|
|
||||||
};
|
|
||||||
|
|
||||||
system.nixos.tags =
|
|
||||||
let
|
|
||||||
cfg = config.boot.loader.raspberryPi;
|
|
||||||
in
|
|
||||||
[
|
|
||||||
"raspberry-pi-${cfg.variant}"
|
|
||||||
cfg.bootloader
|
|
||||||
config.boot.kernelPackages.kernel.version
|
|
||||||
];
|
|
||||||
|
|
||||||
imports =
|
imports =
|
||||||
with config.flake.modules.nixos;
|
with config.flake.modules.nixos;
|
||||||
with inputs.nixos-raspberrypi.nixosModules;
|
with inputs.nixos-raspberrypi.nixosModules;
|
||||||
[
|
[
|
||||||
inputs.catppuccin.nixosModules.catppuccin
|
inputs.catppuccin.nixosModules.catppuccin
|
||||||
raspberry-pi-5.base
|
raspberry-pi-5.base
|
||||||
raspberry-pi-5.page-size-16k # Recommended: optimizations and fixes for issues arising from 16k memory page size (only for systems running default rpi5 (bcm2712) kernel)
|
|
||||||
raspberry-pi-5.bluetooth
|
|
||||||
raspberry-pi-5.display-vc4 # display
|
|
||||||
|
|
||||||
# System modules
|
# System modules
|
||||||
base
|
base
|
||||||
|
|
@ -105,14 +79,6 @@ in
|
||||||
interface = "wlan0";
|
interface = "wlan0";
|
||||||
};
|
};
|
||||||
|
|
||||||
wireless = {
|
|
||||||
enable = true;
|
|
||||||
networks = {
|
|
||||||
"Slow Internet" = {
|
|
||||||
pskRaw = "521b6d766b27276c29c7b6bec5b495b1c52bf88b0682277e65b37dc649b630de";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
443
|
443
|
||||||
|
|
@ -251,5 +217,19 @@ in
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot/firmware" = {
|
||||||
|
device = "/dev/disk/by-uuid/2178-694E";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"fmask=0022"
|
||||||
|
"dmask=0022"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue