begin work on other system configs

This commit is contained in:
2024-12-02 10:42:05 -06:00
parent 9cf417eb9e
commit c2e2c4c2f6
5 changed files with 144 additions and 153 deletions

View File

@@ -50,5 +50,14 @@
];
};
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
./system-config/configuration/laptop
];
};
};
}

View File

@@ -2,24 +2,9 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, lib, pkgs, ... }:
{ config, pkgs, ... }:
{
options.sysconfig.laptop.enable = lib.options.mkOption {
type = lib.types.bool;
};
config = lib.mkIf config.sysconfig.laptop.enable {
assertions = [
{
assertion = !config.sysconfig.homebox.enable;
message = "sysconfig.laptop conflicts with homebox!";
}
];
nixpkgs.config.allowUnfree = true;
# Bootloader.
@@ -80,7 +65,6 @@
services.xserver = {
enable = true;
videoDrivers = ["nvidia"];
};
services.displayManager.enable = true;
@@ -122,5 +106,4 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
};
}

View File

@@ -0,0 +1,5 @@
{ config, lib, pkgs, inputs, ... }: {
system.stateVersion = "24.05";
}

View File

@@ -0,0 +1,71 @@
{
device ? throw "Set this to your disk device, e.g. /dev/sda",
...
}: {
disko.devices = {
disk = {
main = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = ["subvol=persist" "noatime"];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = ["subvol=nix" "noatime"];
mountpoint = "/nix";
};
};
};
};
};
};
};
};
}

View File

@@ -1,77 +0,0 @@
{
description = "install nixos declaratively";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
};
outputs = { ... }@inputs: let
system = "x86_64-linux";
devices = {
main = "/dev/nvme0n1";
bonus.disk1 = "/dev/nvme1n1";
};
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
nixosConfigurations.homebox = inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules = [
inputs.disko.nixosModules.default
inputs.impermanence.nixosModules.impermanece
./disko
./impermanece
];
sysconfig.opts = {
inherit devices;
};
disko = {
enable = true;
impermanent = true;
};
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
networking = {
hostName = "homebox";
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
networkmanager.enable = true;
};
users.users."nathan" = {
isNormalUser = true;
description = "Nathan";
initialPassword = "7567";
extraGroups = [ "wheel" "networkmanager" ];
};
services.openssh.enable = true;
environment.systemPackages = with pkgs; [
git
home-manager
];
};
};
}