nix nix nix (more nix)

This commit is contained in:
2025-09-22 18:11:37 +01:00
parent acd6c0bd6a
commit 2c60fdb0f9
5 changed files with 119 additions and 8 deletions

View File

@@ -8,6 +8,7 @@
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./modules/greetd/nixos.nix
];
# Use the systemd-boot EFI boot loader.
@@ -77,15 +78,18 @@
tree
];
};
users.mutableUsers = false;
# users.users.doloro.hashedPasswordFile = config.sops.secrets."doloro-hashed_password".path;
# users.users.root.hashedPasswordFile = config.sops.secrets."root-hashed_password".path;
users.users.root.initialPassword = "root";
# programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# ];
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
@@ -129,6 +133,5 @@
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "25.11"; # Did you read the comment?
}

66
nix/disks.nix Normal file
View File

@@ -0,0 +1,66 @@
{
lib,
inputs,
...
}:
{
imports = [
inputs.disko.nixosModules.disko
];
disko.devices = {
disk = {
main = {
device = lib.mkDefault "nvme-CT1000P2SSD8_2221E632CD1F";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
ESP = {
name = "ESP";
priority = 1;
size = "4G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
# Subvolume name is different from mountpoint
"@" = {
mountpoint = "/";
};
# Subvolume name is the same as the mountpoint
"@home" = {
mountpoint = "/home";
};
# Parent is not mounted so the mountpoint must be set
"@nix" = {
mountpoint = "/nix";
};
"@blackhole" = {
mountpoint = "/var/blackhole";
};
};
};
};
};
};
};
};
};
}

View File

@@ -17,6 +17,9 @@
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
@@ -40,7 +43,7 @@
# to pass through arguments to home.nix
};
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
modules = [ ./configuration.nix inputs.sops-nix.nixosModules.sops ];
modules = [ ./configuration.nix inputs.sops-nix.nixosModules.sops inputs.disko.nixosModules.disko ];
};
};
}

View File

@@ -0,0 +1,3 @@
_: {
nixos: ./nixos.nix;
}

View File

@@ -0,0 +1,36 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.modules.greetd;
tuigreet = "${pkgs.tuigreet}/bin/tuigreet";
in
{
options.modules.greetd = {
enable = lib.mkEnableOption "Greetd configuration module";
};
config = {
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${tuigreet} --time --remember --cmd Hyprland";
user = "greeter";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal";
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
};
}