From 1b0796e4dd02a69956c60dcbde7b10b631d4ca45 Mon Sep 17 00:00:00 2001 From: tulg Date: Sun, 19 Oct 2025 21:56:53 +0300 Subject: [PATCH] disko siken --- flake.fucked | 62 +++++++++++++++++++++ flake.lock | 63 +++++++++++++++++++--- flake.morefucked | 98 ++++++++++++++++++++++++++++++++++ flake.nix | 71 +++++++++++++++++++----- flake.old | 4 +- hosts/virgil/configuration.nix | 5 +- hosts/virgil/disko.nix | 36 +++++++++++++ modules/home.nix | 7 +-- 8 files changed, 319 insertions(+), 27 deletions(-) create mode 100644 flake.fucked create mode 100644 flake.morefucked create mode 100644 hosts/virgil/disko.nix diff --git a/flake.fucked b/flake.fucked new file mode 100644 index 0000000..3d825a5 --- /dev/null +++ b/flake.fucked @@ -0,0 +1,62 @@ +{ + description = "Tulga's multi-device NixOS configuration (no global modules)"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-colors.url = "github:misterio77/nix-colors"; + + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager, nix-colors, disko, ... } @ inputs: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in { + + # + nixosConfigurations.virgil = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./hosts/virgil/configuration.nix + home-manager.nixosModules.home-manager + ./modules/home.nix + ]; + specialArgs = { inherit inputs pkgs self ; }; + }; + + # + nixosConfigurations.archangel = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./hosts/archangel/configuration.nix + ]; + specialArgs = { inherit ; }; + }; + + # placeholder + #nixosConfigurations.server = nixpkgs.lib.nixosSystem { + # inherit system; + # modules = [ + # ./hosts/server/configuration.nix + # ]; + # }; + }; +} diff --git a/flake.lock b/flake.lock index 22b39c3..2c07dd7 100644 --- a/flake.lock +++ b/flake.lock @@ -43,11 +43,11 @@ ] }, "locked": { - "lastModified": 1760641408, - "narHash": "sha256-Y086n2U0kN9HjOo+UScwQDS27gKMiIlT6vDehvlmdAg=", + "lastModified": 1760887455, + "narHash": "sha256-/xU8iYZjolWbMUNBQF6af5zgGs73Qw21WMgz1tLs3Yw=", "owner": "nix-community", "repo": "home-manager", - "rev": "847669dabf374d32a072bdab3f08cae7296ac011", + "rev": "aeabc1ac63e6ebb8ba4714c4abdfe0556f2de765", "type": "github" }, "original": { @@ -127,15 +127,66 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1760524057, + "narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", "home-manager": "home-manager", "nix-colors": "nix-colors", "nixpkgs": "nixpkgs", + "spicetify-nix": "spicetify-nix", "zen-browser": "zen-browser" } }, + "spicetify-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2", + "systems": "systems" + }, + "locked": { + "lastModified": 1760848035, + "narHash": "sha256-H3MFH8+i4wFagkebtHPcosQdkmxQ4a6fl1lMbLb+RkA=", + "owner": "Gerg-L", + "repo": "spicetify-nix", + "rev": "cde9f78ae705343a38f5d1d19ab34858b5e9caa9", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "spicetify-nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "zen-browser": { "inputs": { "home-manager": "home-manager_2", @@ -144,11 +195,11 @@ ] }, "locked": { - "lastModified": 1760646099, - "narHash": "sha256-hFoiRU9tM0ilgZS4gSO00nbnsuTQoYGQBb8+5Vma3Og=", + "lastModified": 1760898315, + "narHash": "sha256-d2qbZpREjUQm65lzS70b2TVgTfOpAjQUZa+FS58+WnA=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "f3fd50667a6ab075b1e7c406ff30c54684cefa16", + "rev": "5e52b6a9ec07d22c9555891005b1b39f1bbd83ed", "type": "github" }, "original": { diff --git a/flake.morefucked b/flake.morefucked new file mode 100644 index 0000000..8533716 --- /dev/null +++ b/flake.morefucked @@ -0,0 +1,98 @@ +{ + description = "NixOS configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + spicetify-nix.url = "github:Gerg-L/spicetify-nix"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-colors.url = "github:misterio77/nix-colors"; + + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager, nix-colors, disko, ... } @ inputs: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in + { + nixosConfigurations = { + + # ------------------------ + # Virgil machine + # ------------------------ + virgil = nixpkgs.lib.nixosSystem { + inherit system; + + modules = [ + ./hosts/virgil/configuration.nix + home-manager.nixosModules.home-manager + inputs.disko.nixosModules.disko + { + home-manager.users.tulg.imports = [ ./modules/home.nix ]; + home-manager.extraSpecialArgs = { + spicetify-nix = inputs.spicetify-nix; + zen-browser = inputs.zen-browser; + }; + } + ]; + }; + + # ------------------------ + # archangel + # ------------------------ + archangel = nixpkgs.lib.nixosSystem { + inherit system; + + modules = [ + ./hosts/archangel/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.users.tulg.imports = [ ./modules/home.nix ]; + home-manager.extraSpecialArgs = { + spicetify-nix = inputs.spicetify-nix; + zen-browser = inputs.zen-browser; + }; + } + ]; + }; + + # ------------------------ + # Placeholder machine 2 + # ------------------------ + machine2 = nixpkgs.lib.nixosSystem { + inherit system; + + modules = [ + ./hosts/machine2/configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.users.tulg.imports = [ ./modules/home.nix ]; + home-manager.extraSpecialArgs = { + spicetify-nix = inputs.spicetify-nix; + zen-browser = inputs.zen-browser; + }; + } + ]; + }; + + }; + }; +} diff --git a/flake.nix b/flake.nix index c32fd63..7b8b6fa 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,9 @@ { - description = "Tulga's multi-device NixOS configuration (no global modules)"; + description = "NixOS configuration"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + spicetify-nix.url = "github:Gerg-L/spicetify-nix"; home-manager = { url = "github:nix-community/home-manager"; @@ -22,35 +23,79 @@ }; }; - outputs = { self, nixpkgs, home-manager, nix-colors, zen-browser, disko, ... }: + outputs = { self, nixpkgs, home-manager, nix-colors, disko, ... } @ inputs: let system = "x86_64-linux"; - in { - # + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in + { nixosConfigurations.virgil = nixpkgs.lib.nixosSystem { inherit system; + specialArgs = { inherit inputs; }; modules = [ ./hosts/virgil/configuration.nix home-manager.nixosModules.home-manager + inputs.disko.nixosModules.disko + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs nix-colors; }; + backupFileExtension = "backup"; + + users.tulg = { + imports = [ ./modules/home.nix ]; + }; + }; + } ]; - specialArgs = { inherit home-manager; }; }; - # nixosConfigurations.archangel = nixpkgs.lib.nixosSystem { inherit system; + specialArgs = { inherit inputs; }; modules = [ ./hosts/archangel/configuration.nix home-manager.nixosModules.home-manager + inputs.disko.nixosModules.disko + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs nix-colors; }; + backupFileExtension = "backup"; + + users.tulg = { + imports = [ ./modules/home.nix ]; + }; + }; + } ]; }; + #placeholder + nixosConfigurations.phoenix = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/phoenix/configuration.nix + home-manager.nixosModules.home-manager + inputs.disko.nixosModules.disko + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs nix-colors; }; + backupFileExtension = "backup"; - # placeholder - #nixosConfigurations.server = nixpkgs.lib.nixosSystem { - # inherit system; - # modules = [ - # ./hosts/server/configuration.nix - # ]; - # }; + users.tulg = { + imports = [ ./modules/home.nix ]; + }; + }; + } + ]; + }; }; } diff --git a/flake.old b/flake.old index 845abe1..87da32b 100644 --- a/flake.old +++ b/flake.old @@ -36,7 +36,7 @@ inherit system; specialArgs = { inherit inputs; }; modules = [ - ./configuration.nix + ./hosts/virgil/configuration.nix home-manager.nixosModules.home-manager inputs.disko.nixosModules.disko { @@ -50,7 +50,7 @@ backupFileExtension = "backup"; users.tulg = { - imports = [ ./home.nix ]; + imports = [ ./modules/home.nix ]; }; }; } diff --git a/hosts/virgil/configuration.nix b/hosts/virgil/configuration.nix index abfefc8..900a744 100644 --- a/hosts/virgil/configuration.nix +++ b/hosts/virgil/configuration.nix @@ -2,17 +2,16 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, home-manager, ... }: +{ config, pkgs, self, ... }: { imports = [ # Include the results of the hardware scan. +# ./disko.nix ./hardware-configuration.nix - home-manager.nixosModules.home-manager ]; - home-manager.users.tulg = import ../../modules/home.nix; # Bootloader. boot.loader.systemd-boot.enable = true; diff --git a/hosts/virgil/disko.nix b/hosts/virgil/disko.nix new file mode 100644 index 0000000..8125cd3 --- /dev/null +++ b/hosts/virgil/disko.nix @@ -0,0 +1,36 @@ +{ + disko.devices = { + disk = { + nixos = { + type = "disk"; + device = "/dev/vda"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/home.nix b/modules/home.nix index dc6e7a5..1e9ba38 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -1,16 +1,17 @@ -{ config, lib, pkgs, inputs, nix-colors, ... }: +{ config, lib, pkgs, inputs, ... }: let - dots = "${config.home.homeDirectory}/nixdots/config"; + dots = "${config.home.homeDirectory}/nixdots/config"; symlink = path: config.lib.file.mkOutOfStoreSymlink path; spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system}; in { - imports = [ + imports = [ inputs.zen-browser.homeModules.twilight inputs.spicetify-nix.homeManagerModules.default ]; + # Home Manager settings home.username = "tulg"; home.homeDirectory = "/home/tulg"; home.stateVersion = "25.05";