diff --git a/flake.nix b/flake.nix index 2da3826..16a0d7f 100644 --- a/flake.nix +++ b/flake.nix @@ -51,6 +51,30 @@ ]; }; + nixosConfigurations.bocchi = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/nixos-common.nix + + ./modules/nix/linux.nix + ./modules/shell.nix + + ./modules/services/caddy.nix + ./modules/services/ssh.nix + ./modules/network/vpn/tailscale.nix + ./modules/services/uptime-kuma.nix + + ./modules/services/media/arr.nix + ./modules/services/media/jellyfin.nix + + ./modules/users/nico.nix + + ./hosts/bocchi/configuration.nix + ./hosts/nixos-common.nix + disko.nixosModules.disko + ]; + }; + darwinConfigurations.kita = nix-darwin.lib.darwinSystem { system = "aarch64-darwin"; modules = [ diff --git a/hosts/bocchi/configuration.nix b/hosts/bocchi/configuration.nix new file mode 100644 index 0000000..b6f60ba --- /dev/null +++ b/hosts/bocchi/configuration.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./disko.nix +# ./hardware-configuration.nix + ]; + + networking.hostName = "bocchi"; + + hardware.graphics.enable = true; +} diff --git a/hosts/bocchi/disko.nix b/hosts/bocchi/disko.nix new file mode 100644 index 0000000..50513b6 --- /dev/null +++ b/hosts/bocchi/disko.nix @@ -0,0 +1,78 @@ +{ ... }: + +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + 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 + "/root" = { + mountpoint = "/"; + }; + + # Subvolume name is the same as the mountpoint + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + + "/media" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/media"; + }; + + "/media/shows" = { mountOptions = [ "compress=zstd" ]; }; + "/media/movies" = { mountOptions = [ "compress=zstd" ]; }; + "/media/music" = { mountOptions = [ "compress=zstd" ]; }; + "/media/book" = { mountOptions = [ "compress=zstd" ]; }; + "/media/repositories" = { mountOptions = [ "compress=zstd" ]; }; + "/media/torrents" = { mountOptions = [ "compress=zstd" ]; }; + + # Subvolume for the swapfile + "/swap" = { + mountpoint = "/.swapvol"; + swap = { + swapfile.size = "20M"; + swapfile2.size = "20M"; + swapfile2.path = "rel-path"; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +}