Merge remote-tracking branch 'origin/server-config'
This commit is contained in:
commit
62493285d2
65 changed files with 229 additions and 83 deletions
96
flake.nix
96
flake.nix
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
description = "A simple NixOS flake";
|
||||
description = "My NixOS desktop and server configs";
|
||||
|
||||
inputs = {
|
||||
|
||||
|
@ -28,55 +28,97 @@
|
|||
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, disko, nixos-hardware, ... }@inputs:
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@attrs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
forAllSystems = nixpkgs.lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
];
|
||||
inherit (nixpkgs) lib;
|
||||
configVars = import /home/willifan/.nix-config/vars { inherit inputs lib; };
|
||||
specialArgs = { inherit inputs outputs configVars nixpkgs; };
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
forAllSystemsUnstable = nixpkgs-unstable.lib.genAttrs supportedSystems;
|
||||
|
||||
pkgs = forAllSystems (system: import nixpkgs { inherit system; });
|
||||
pkgs-unstable = forAllSystemsUnstable (system: import nixpkgs-unstable { inherit system; });
|
||||
|
||||
in
|
||||
{
|
||||
# Please replace my-nixos with your hostname
|
||||
nixosConfigurations = {
|
||||
|
||||
Lenni = lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
Lenni = let
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
|
||||
specialArgs = {
|
||||
hostname = "Lenni";
|
||||
type = "desktop";
|
||||
inherit system;
|
||||
};
|
||||
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
attrs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
#home-manager.users.willifan = import ./users/willifan/home;
|
||||
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
|
||||
}
|
||||
disko.nixosModules.disko
|
||||
nixos-hardware.nixosModules.framework-12th-gen-intel
|
||||
attrs.disko.nixosModules.disko
|
||||
attrs.nixos-hardware.nixosModules.framework-12th-gen-intel
|
||||
./hosts
|
||||
./users/willifan
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
Puenktchen = lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
Puenktchen = let
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
|
||||
specialArgs = {
|
||||
hostname = "Puenktchen";
|
||||
type = "desktop";
|
||||
inherit system;
|
||||
};
|
||||
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
attrs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
#home-manager.users.willifan = import ./users/willifan/home;
|
||||
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
|
||||
}
|
||||
disko.nixosModules.disko
|
||||
nixos-hardware.nixosModules.common-cpu-amd
|
||||
nixos-hardware.nixosModules.common-cpu-amd-pstate
|
||||
nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
||||
nixos-hardware.nixosModules.common-gpu-amd
|
||||
attrs.disko.nixosModules.disko
|
||||
attrs.nixos-hardware.nixosModules.common-cpu-amd
|
||||
attrs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
||||
attrs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
||||
attrs.nixos-hardware.nixosModules.common-gpu-amd
|
||||
./hosts
|
||||
./users/willifan
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
Anton = let
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
|
||||
specialArgs = {
|
||||
hostname = "Anton";
|
||||
type = "server";
|
||||
inherit system;
|
||||
};
|
||||
|
||||
modules = [
|
||||
attrs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
}
|
||||
attrs.disko.nixosModules.disko
|
||||
attrs.nixos-hardware.nixosModules.common-cpu-amd
|
||||
attrs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
||||
attrs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
||||
./hosts
|
||||
./users/willifan
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -1,18 +1,4 @@
|
|||
{ pkgs, configVars, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
networking.hostName = configVars.hostname;
|
||||
imports = [
|
||||
./nix-ld.nix
|
||||
./boot.nix
|
||||
./printers.nix
|
||||
];
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
services.hardware.bolt.enable = true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
console.keyMap = "de";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
system.stateVersion = "23.11";
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
{ pkgs, configVars, ... }:
|
||||
{ pkgs, hostname, type, ... }:
|
||||
{
|
||||
imports = [
|
||||
./common
|
||||
./${configVars.hostname}
|
||||
./${type}
|
||||
./${hostname}
|
||||
];
|
||||
}
|
17
hosts/desktop/default.nix
Normal file
17
hosts/desktop/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, hostname, ... }:
|
||||
{
|
||||
networking.hostName = hostname;
|
||||
imports = [
|
||||
./nix-ld.nix
|
||||
./boot.nix
|
||||
./printers.nix
|
||||
];
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
services.hardware.bolt.enable = true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
console.keyMap = "de";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
}
|
19
hosts/server/Anton/data.nix
Normal file
19
hosts/server/Anton/data.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
mergerfs
|
||||
];
|
||||
|
||||
fileSystems."/storage" = {
|
||||
fsType = "fuse.mergerfs";
|
||||
device = "/mnt/disks/*";
|
||||
options = ["cache.files=partial" "dropcacheonclose=true" "category.create=mfs"];
|
||||
};
|
||||
|
||||
services.snapraid = {
|
||||
enable = true;
|
||||
|
||||
};
|
||||
|
||||
}
|
11
hosts/server/Anton/default.nix
Normal file
11
hosts/server/Anton/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
|
||||
./disko.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
];
|
||||
|
||||
}
|
52
hosts/server/Anton/disko.nix
Normal file
52
hosts/server/Anton/disko.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
root-drive = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/wwn-0x5001b44ebc0b613a";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
priority = 1;
|
||||
name = "ESP";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
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
|
||||
"/rootfs" = {
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
mountpoint = "/";
|
||||
};
|
||||
# Subvolume name is the same as the mountpoint
|
||||
"/home" = {
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
mountpoint = "/home";
|
||||
};
|
||||
# Parent is not mounted so the mountpoint must be set
|
||||
"/nix" = {
|
||||
mountOptions = [ "compress=zstd" "noatime" ];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
({ pkgs, ... }: {
|
||||
|
||||
systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
users.users.nixos.openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMRriQfw3pusl04fGhCNVoRRpye71ZwkDXAtKB/FP1DLXA4cYrwjLzv/fG1hXi7lAMp2vLiABAg/UaTE8roGzlt62XsFNwc1TI5M8m67J0kLkCtz3MkIixe/3GOFXr03g80DPncLyoIYPvvNd/TftTBK4yrrZPvMJaRrZhW/QdLPQpdHalcNRZ4bnBOCtCoqQ6RGrRi2EeKaJDYIFNl13b9FxrXEJcXnbSDdr1KI3q7a+vkefI2knUf2Uk7ufOWTQ1aqc0heGtCNlHzwZUzW/dfrpPmoVPq3Fqxqd9uXqxMk1Z3VnOwWcK3VXfzzBXKTsX0MaUgF1EqxibkYs9bDZqLEXoRucBqk3wwMPy8RJXqQOupoqa2xEOoduBf1qDHEEm69coHCpPm2mQVUrwsPrmTHmOjh9ir0mkVBDRgHvhq/ctQTVO5/SE2NCgPdlvUV5s44LLsUyxBp5JWwXZWlVys+7Dhil6mtRDcH4CXceJn0VZ61Zv2jrCTxQjKsroitSkNbpAkKajQ9moLMAblsSwJzl3uvJJ3ydlxjZefwTO/GjyuJMY2sIU2Tu0YbIVgMyq5L782LduVlyWj+RLWoEu19OfMqQvTWhJnQPAbR82qGzlfTGRLUxoY+G5MYipJwgrBQ2TnpWvfpTrZxFrglSfekz0v54lWzNZpW+irImh4w== willifan@proton.me"
|
||||
];
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
|||
nano
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
7
users/willifan/Lenni/default.nix
Normal file
7
users/willifan/Lenni/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./auto-cpufreq.nix
|
||||
./backlight.nix
|
||||
];
|
||||
}
|
4
users/willifan/Puenktchen/default.nix
Normal file
4
users/willifan/Puenktchen/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
}
|
15
users/willifan/common/default.nix
Normal file
15
users/willifan/common/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, home-manager, ... }:
|
||||
{
|
||||
imports = [
|
||||
./envvar.nix
|
||||
./git.nix
|
||||
./hyfetch.nix
|
||||
./locales.nix
|
||||
#./ssh.nix
|
||||
./syncthing.nix
|
||||
./user.nix
|
||||
#./zsh.nix
|
||||
];
|
||||
|
||||
home-manager.users.willifan.home.stateVersion = "23.11";
|
||||
}
|
|
@ -1,31 +1,8 @@
|
|||
{ pkgs, home-manager, ... }:
|
||||
{ pkgs, hostname, type, ... }:
|
||||
{
|
||||
imports = [
|
||||
./graphical
|
||||
|
||||
./applications.nix
|
||||
./auto-cpufreq.nix
|
||||
./envvar.nix
|
||||
./git.nix
|
||||
./hyfetch.nix
|
||||
./locales.nix
|
||||
#./ssh.nix
|
||||
./syncthing.nix
|
||||
./udev.nix
|
||||
./user.nix
|
||||
#./zsh.nix
|
||||
./common
|
||||
./${type}
|
||||
./${hostname}
|
||||
];
|
||||
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = rec {
|
||||
initial_session = {
|
||||
command = ''Hyprland'';
|
||||
user = "willifan";
|
||||
};
|
||||
default_session = initial_session;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.willifan.home.stateVersion = "23.11";
|
||||
}
|
|
@ -7,8 +7,6 @@
|
|||
jq
|
||||
xorg.xrandr
|
||||
|
||||
btop
|
||||
|
||||
feh
|
||||
|
||||
enpass
|
13
users/willifan/desktop/autologin.nix
Normal file
13
users/willifan/desktop/autologin.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
settings = rec {
|
||||
initial_session = {
|
||||
command = ''Hyprland'';
|
||||
user = "willifan";
|
||||
};
|
||||
default_session = initial_session;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, home-manager-unstable, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
|
@ -9,6 +9,8 @@
|
|||
./theme
|
||||
./web
|
||||
|
||||
./applications.nix
|
||||
./autologin.nix
|
||||
./kitty.nix
|
||||
./thunar.nix
|
||||
];
|
7
users/willifan/desktop/hyprland/default.nix
Normal file
7
users/willifan/desktop/hyprland/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, hostname, ... }:
|
||||
{
|
||||
imports = [
|
||||
./common
|
||||
./${hostname}
|
||||
];
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, home-manager-unstable, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
|
@ -1,7 +0,0 @@
|
|||
{ pkgs, configVars, ... }:
|
||||
{
|
||||
imports = [
|
||||
./common
|
||||
./${configVars.hostname}
|
||||
];
|
||||
}
|
Loading…
Add table
Reference in a new issue