forked from aylac.top/nixcfg
this repo has no description

WHAT'S UPCLOUD NOT MUCH HOW ABOUT YOU FINALLY

Changed files
+275 -10
hosts
modules
disko
btrfs-vps
flake
hardware
home
programs
firefox
zed-editor
nixos
profiles
users
+6 -6
flake.lock
···
},
"nixpkgs-unstable": {
"locked": {
-
"lastModified": 1755082269,
-
"narHash": "sha256-Ix7ALeaxv9tW4uBKWeJnaKpYZtZiX4H4Q/MhEmj4XYA=",
+
"lastModified": 1755175540,
+
"narHash": "sha256-V0j2S1r25QnbqBLzN2Rg/dKKil789bI3P3id7bDPVc4=",
"owner": "NixOS",
"repo": "nixpkgs",
-
"rev": "d74de548348c46cf25cb1fcc4b74f38103a4590d",
+
"rev": "a595dde4d0d31606e19dcec73db02279db59d201",
"type": "github"
},
"original": {
···
"secrets": {
"flake": false,
"locked": {
-
"lastModified": 1755136756,
-
"narHash": "sha256-NHiEnaE16LFEhNQRj1VEt+9JMxaFcvW83XcBCrutcY8=",
+
"lastModified": 1755224537,
+
"narHash": "sha256-u6wcGJzFvneLk1O/CGtJb8gNYDYiRzl1Ig9DgdO6kUk=",
"owner": "ayla6",
"repo": "secrets",
-
"rev": "4a6af64c7280b8c5a70bb549d880adb1162821df",
+
"rev": "a80c405683389816580d0b9595c27d12b1d7cfff",
"type": "github"
},
"original": {
+1 -1
flake.nix
···
./modules/flake
inputs.actions-nix.flakeModules.default
inputs.files.flakeModules.default
-
#inputs.git-hooks-nix.flakeModule
+
inputs.git-hooks-nix.flakeModule
inputs.home-manager.flakeModules.home-manager
];
};
+28
hosts/jezebel/README.md
···
+
a super low end upcloud vm that i got
+
+
VERY VERY IMPORTANT NOTES:
+
+
this was hell to setup, mostly because i wasn't sure if i could modprobe zram. but you can in fact do it and turn a 1gb of ram system into something more usable that let's you actually build the damn thing
+
+
so three very important things
+
+
USE ZRAM ON THE INSTALLER
+
run this
+
+
```sh
+
modprobe zram
+
echo zstd >/sys/block/zram0/comp_algorithm
+
echo "2G" >/sys/block/zram0/disksize
+
mkswap /dev/zram0
+
swapon --priority 100 /dev/zram0
+
```
+
+
and when building it with nixos-anywhere be sure to use the --no-diskos-deps flag!!!
+
+
```sh
+
nix run github:nix-community/nixos-anywhere -- --no-disko-deps --flake <flake_location>#<system> --target-host root@<ip_address>
+
```
+
+
thank you @nocab.lol for helping me quite a lot with the disko part!!
+
+
I FUCKING LOVE ZRAM
+56
hosts/jezebel/default.nix
···
+
{
+
self,
+
modulesPath,
+
...
+
}: {
+
imports = [
+
./secrets.nix
+
self.nixosModules.locale-en-gb
+
"${modulesPath}/profiles/qemu-guest.nix"
+
self.diskoConfigurations.btrfs-vps
+
];
+
+
networking.hostName = "jezebel";
+
system.stateVersion = "25.05";
+
time.timeZone = "America/Sao_Paulo";
+
nixpkgs.hostPlatform = "x86_64-linux";
+
+
myNixOS = {
+
programs = {
+
nix.enable = true;
+
};
+
profiles = {
+
base.enable = true;
+
btrfs.enable = true;
+
server.enable = true;
+
autoUpgrade = {
+
enable = true;
+
operation = "switch";
+
};
+
};
+
services = {
+
caddy.enable = true;
+
tailscale = {
+
enable = true;
+
enableCaddy = true;
+
};
+
};
+
};
+
+
services = {
+
qemuGuest.enable = true;
+
spice-vdagentd.enable = true;
+
};
+
+
boot = {
+
loader.grub = {
+
enable = true;
+
};
+
initrd = {
+
availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
+
kernelModules = [];
+
};
+
kernelModules = [""];
+
extraModulePackages = [];
+
};
+
}
+5
hosts/jezebel/secrets.nix
···
+
{self, ...}: {
+
age.secrets = {
+
tailscaleAuthKey.file = "${self.inputs.secrets}/tailscale/auth.age";
+
};
+
}
+1 -2
hosts/nanpi/default.nix
···
caddy.enable = true;
tailscale = {
enable = true;
-
enableCaddy = false;
+
enableCaddy = true;
operator = "ayla";
};
syncthing = {
···
qbittorrent = {
inherit (config.mySnippets.tailnet.networkMap.qbittorrent) port;
enable = true;
-
openFirewall = true;
};
};
};
+83
modules/disko/btrfs-vps/default.nix
···
+
{
+
config,
+
lib,
+
...
+
}: {
+
options.myDisko.installDrive = lib.mkOption {
+
description = "Disk to install NixOS to.";
+
default = "/dev/vda";
+
type = lib.types.str;
+
};
+
+
config = {
+
assertions = [
+
{
+
assertion = config.myDisko.installDrive != "";
+
message = "config.myDisko.installDrive cannot be empty.";
+
}
+
];
+
disko.devices = {
+
disk.main = {
+
type = "disk";
+
device = config.myDisko.installDrive;
+
content = {
+
type = "gpt";
+
partitions = {
+
boot = {
+
size = "1M";
+
type = "EF02";
+
priority = 1;
+
};
+
ESP = {
+
size = "512M";
+
type = "EF00";
+
content = {
+
type = "filesystem";
+
format = "vfat";
+
mountpoint = "/boot";
+
};
+
};
+
swap = {
+
size = "4G";
+
content = {
+
type = "swap";
+
resumeDevice = true;
+
};
+
};
+
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 = "/";
+
mountOptions = ["noatime" "compress=zstd"];
+
};
+
"/nix" = {
+
mountOptions = ["subvol=nix" "noatime" "compress=zstd"];
+
mountpoint = "/nix";
+
};
+
};
+
};
+
};
+
};
+
};
+
};
+
};
+
};
+
}
+2
modules/flake/nixos.nix
···
btrfs-subvolumes = ../disko/btrfs-subvolumes;
luks-btrfs-subvolumes = ../disko/luks-btrfs-subvolumes;
lvm-ext4 = ../disko/lvm-ext4;
+
btrfs-vps = ../disko/btrfs-vps;
};
nixosModules = {
···
inputs.nixpkgs.lib.genAttrs [
"morgana"
"nanpi"
+
"jezebel"
] (
host:
inputs.nixpkgs.lib.nixosSystem {
+22
modules/hardware/amd/cpu/default.nix
···
+
{
+
config,
+
lib,
+
...
+
}: {
+
options.myHardware.amd.cpu.enable = lib.mkEnableOption "AMD CPU configuration.";
+
+
config = lib.mkIf config.myHardware.amd.cpu.enable {
+
boot = {
+
blacklistedKernelModules = ["k10temp"]; # Conflicts with zenpower
+
extraModulePackages = with config.boot.kernelPackages; [zenpower];
+
+
kernelModules = [
+
"kvm-amd"
+
"zenpower" # Improved temperature monitoring
+
];
+
};
+
+
hardware.cpu.amd.updateMicrocode = true;
+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+
};
+
}
+6
modules/hardware/amd/default.nix
···
+
{...}: {
+
imports = [
+
./cpu
+
./gpu
+
];
+
}
+29
modules/hardware/amd/gpu/default.nix
···
+
{
+
config,
+
lib,
+
...
+
}: {
+
options.myHardware.amd.gpu.enable = lib.mkEnableOption "AMD GPU configuration.";
+
+
config = lib.mkIf config.myHardware.amd.gpu.enable {
+
environment.variables = {
+
DPAU_DRIVER = "radeonsi";
+
GSK_RENDERER = "ngl";
+
};
+
+
hardware = {
+
amdgpu = {
+
initrd.enable = true;
+
+
amdvlk = {
+
enable = true;
+
support32Bit.enable = true;
+
};
+
+
opencl.enable = true;
+
};
+
+
graphics.enable = true;
+
};
+
};
+
}
+1
modules/hardware/default.nix
···
./hp
./lenovo
./profiles
+
./amd
];
}
+1
modules/home/programs/firefox/default.nix
···
}
'';
};
+
test = {};
};
};
};
+1 -1
modules/home/programs/zed-editor/default.nix
···
use_on_type_format = true;
wrap_guides = [100];
minimap.show = "auto";
-
preferred_line_length = 80;
+
preferred_line_length = 100;
soft_wrap = "preferred_line_length";
agent = {
+1
modules/nixos/profiles/default.nix
···
./server
./autoUpgrade
./tmpOnTmpfs
+
./swap
];
}
+26
modules/nixos/profiles/swap/default.nix
···
+
{
+
config,
+
lib,
+
...
+
}: {
+
options.myNixOS.profiles.swap = {
+
enable = lib.mkEnableOption "swap file";
+
+
size = lib.mkOption {
+
default = 8192;
+
description = "Swap size in megabytes.";
+
type = lib.types.int;
+
};
+
};
+
+
config = lib.mkIf config.myNixOS.profiles.swap.enable {
+
swapDevices = [
+
{
+
device = "/.swap";
+
priority = 0;
+
randomEncryption.enable = true;
+
inherit (config.myNixOS.profiles.swap) size;
+
}
+
];
+
};
+
}
+6
modules/users/default.nix
···
lib,
config,
pkgs,
+
self,
...
}: {
imports = [
···
users = {
defaultUserShell = pkgs.fish;
mutableUsers = false;
+
+
users.root.openssh.authorizedKeys.keyFiles =
+
lib.map (file: "${self.inputs.secrets}/publicKeys/${file}")
+
(lib.filter (file: (lib.hasPrefix "ayla_" file) || (lib.hasPrefix "root_morgana" file))
+
(builtins.attrNames (builtins.readDir "${self.inputs.secrets}/publicKeys")));
};
};
}