Compare commits

...

6 Commits

Author SHA1 Message Date
willifan
62493285d2 Merge remote-tracking branch 'origin/server-config' 2024-07-06 21:54:33 +02:00
willifan
f1b559ba06 Reorganized the repo 2024-07-06 21:42:24 +02:00
willifan
5176e7cdf8 added individual host variables and pkgs-unstable 2024-06-27 19:03:36 +02:00
willifan
41224a66a9 removed unnecessary home-manager-unstable arguments 2024-06-27 18:30:20 +02:00
willifan
f6ea49629d removed unnecessary comments 2024-06-27 16:48:21 +02:00
willifan
4c1ec28d03 changed ISO aothorizedKeys to nixos user 2024-06-27 16:04:19 +02:00
65 changed files with 229 additions and 83 deletions

View File

@ -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
];
};
};

View File

@ -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";
}

View File

@ -1,7 +1,8 @@
{ pkgs, configVars, ... }:
{ pkgs, hostname, type, ... }:
{
imports = [
./common
./${configVars.hostname}
./${type}
./${hostname}
];
}

17
hosts/desktop/default.nix Normal file
View 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" ];
}

View 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;
};
}

View File

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
imports = [
./disko.nix
./hardware-configuration.nix
];
}

View 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";
};
};
};
};
};
};
};
};
};
}

View File

@ -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" ];
})
];
};

View File

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
imports = [
./auto-cpufreq.nix
./backlight.nix
];
}

View File

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
}

View 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";
}

View File

@ -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";
}

View File

@ -7,8 +7,6 @@
jq
xorg.xrandr
btop
feh
enpass

View File

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = ''Hyprland'';
user = "willifan";
};
default_session = initial_session;
};
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, home-manager-unstable, ... }:
{ pkgs, ... }:
{
@ -9,6 +9,8 @@
./theme
./web
./applications.nix
./autologin.nix
./kitty.nix
./thunar.nix
];

View File

@ -0,0 +1,7 @@
{ pkgs, hostname, ... }:
{
imports = [
./common
./${hostname}
];
}

View File

@ -1,4 +1,4 @@
{ pkgs, home-manager-unstable, ... }:
{ pkgs, ... }:
{
imports = [

View File

@ -1,7 +0,0 @@
{ pkgs, configVars, ... }:
{
imports = [
./common
./${configVars.hostname}
];
}