diff --git a/common.nix b/common/config.nix similarity index 95% rename from common.nix rename to common/config.nix index 240decf..28405f8 100644 --- a/common.nix +++ b/common/config.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: { - imports = [ ./common-options.nix ]; + imports = [ ./options.nix ]; # just a default. automatic-timezoned on workstations. time.timeZone = lib.mkDefault "America/Chicago"; # It's ASCII, but better! diff --git a/common-options.nix b/common/options.nix similarity index 100% rename from common-options.nix rename to common/options.nix diff --git a/common/partitioning.nix b/common/partitioning.nix new file mode 100644 index 0000000..5b089de --- /dev/null +++ b/common/partitioning.nix @@ -0,0 +1,37 @@ +# common/standard/idk partitioning using disko. +# more or less adapted from yaoi's generated hardware config. +{ config, lib, pkgs, ... }: +{ + disko.devices.disk.main = { + # device is intentionally not specified here. + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + end = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + subvolumes = { + "/root".mountpoint = "/"; + "/home".mountpoint = "/home"; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + }; + }; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/files/product.json b/files/product.json index 032102a..192ae7b 100644 --- a/files/product.json +++ b/files/product.json @@ -1,9 +1,9 @@ { - "extensionsGallery": { - "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", - "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", - "itemUrl": "https://marketplace.visualstudio.com/items", - "controlUrl": "", - "recommendationsUrl": "" - } + "extensionsGallery": { + "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", + "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", + "itemUrl": "https://marketplace.visualstudio.com/items", + "controlUrl": "", + "recommendationsUrl": "" + } } diff --git a/flake.lock b/flake.lock index 063723b..a3e138f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746728054, + "narHash": "sha256-eDoSOhxGEm2PykZFa/x9QG5eTH0MJdiJ9aR00VAofXE=", + "owner": "nix-community", + "repo": "disko", + "rev": "ff442f5d1425feb86344c028298548024f21256d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "latest", + "repo": "disko", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -123,6 +144,7 @@ }, "root": { "inputs": { + "disko": "disko", "home-manager": "home-manager", "lix-module": "lix-module", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index 80cb34f..753c253 100644 --- a/flake.nix +++ b/flake.nix @@ -10,8 +10,12 @@ url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + disko = { + url = "github:nix-community/disko/latest"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { nixpkgs, nixpkgs-unstable, lix-module, home-manager, ... }@inputs: + outputs = { nixpkgs, nixpkgs-unstable, lix-module, home-manager, disko, ... }@inputs: let pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; @@ -22,10 +26,9 @@ specialArgs = { inherit inputs pkgs-unstable; }; system = "x86_64-linux"; modules = [ - ./hardware-configuration.nix lix-module.nixosModules.default home-manager.nixosModules.home-manager - ./common.nix + ./common/config.nix ./workstation.nix ./capabilities/bluetooth.nix @@ -42,10 +45,11 @@ specialArgs = { inherit inputs pkgs-unstable; }; system = "x86_64-linux"; modules = [ - ./hardware-configuration.nix lix-module.nixosModules.default home-manager.nixosModules.home-manager - ./common.nix + disko.nixosModules.disko + ./common/config.nix + ./common/partitioning.nix ./workstation.nix ./capabilities/bluetooth.nix ./hosts/yuri.nix diff --git a/hardware-configuration.nix b/hosts/legacy/yaoi-hardware.nix similarity index 84% rename from hardware-configuration.nix rename to hosts/legacy/yaoi-hardware.nix index d3aea77..7761be1 100644 --- a/hardware-configuration.nix +++ b/hosts/legacy/yaoi-hardware.nix @@ -1,6 +1,5 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. +# generated by nixos-install when setting up yaoi. +# turns out keeping this can cause headaches when going beyond one system. { config, lib, pkgs, modulesPath, ... }: { @@ -49,11 +48,4 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - # bluetooth stuff - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - services.blueman.enable = true; } diff --git a/hosts/yaoi.nix b/hosts/yaoi.nix index 8bbcdbb..98e2ea3 100644 --- a/hosts/yaoi.nix +++ b/hosts/yaoi.nix @@ -1,5 +1,6 @@ { config, lib, pkgs, ... }: { + imports = [ ./legacy/yaoi-hardware.nix ]; networking.hostName = "yaoi"; # battery is fucked services.fwupd.daemonSettings.DisabledPlugins = [ "upower" ]; diff --git a/hosts/yuri.nix b/hosts/yuri.nix index da46c11..b932c40 100644 --- a/hosts/yuri.nix +++ b/hosts/yuri.nix @@ -1,4 +1,8 @@ { config, lib, pkgs, ... }: { networking.hostName = "yuri"; + disko.devices.disk.main.device = "/dev/nvme0n1"; + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/users/hotsocket.nix b/users/hotsocket.nix index 0a62a91..04e96f6 100644 --- a/users/hotsocket.nix +++ b/users/hotsocket.nix @@ -6,7 +6,6 @@ extraGroups = [ "wheel" ]; }; # i love home-manager :) - home-manager.users.hotsocket = if config.isWorkstation then { home = { stateVersion = "25.05"; diff --git a/workstation.nix b/workstation.nix index 2788876..25d781a 100644 --- a/workstation.nix +++ b/workstation.nix @@ -3,7 +3,7 @@ { config, lib, pkgs, pkgs-unstable, ... }: { isWorkstation = true; - imports = [ ./nonfree/hplip.nix ]; # because i have hp bullshit + imports = [ ./nonfree/_allow.nix ./nonfree/hplip.nix ]; # because i have hp bullshit services = { # workstations have a tendency to move one way or another automatic-timezoned.enable = true;