From 67bde4567489660ec152497e735256c42f01a78c Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Thu, 17 Apr 2025 22:43:57 +0200 Subject: [PATCH 1/8] lock update --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 1108c56..6628996 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1744117652, - "narHash": "sha256-t7dFCDl4vIOOUMhEZnJF15aAzkpaup9x4ZRGToDFYWI=", + "lastModified": 1744743431, + "narHash": "sha256-iyn/WBYDc7OtjSawbegINDe/gIkok888kQxk3aVnkgg=", "owner": "nix-community", "repo": "home-manager", - "rev": "b4e98224ad1336751a2ac7493967a4c9f6d9cb3f", + "rev": "c61bfe3ae692f42ce688b5865fac9e0de58e1387", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nix-flatpak": { "locked": { - "lastModified": 1741903049, - "narHash": "sha256-8Y8brH04JjSLrCLvBEbhK9vOu7lhQhqUBW4kI3tifdI=", + "lastModified": 1744659587, + "narHash": "sha256-xJnbmRVte13akgn+Prg06IaRHJ5OX3uVltwsCP/mxoc=", "owner": "gmodena", "repo": "nix-flatpak", - "rev": "42c7fb2702219b86a8f5969c3475ce594c28f5d0", + "rev": "928d868a9141b48f152d3b2b00c433e688d4b106", "type": "github" }, "original": { @@ -74,11 +74,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1743420942, - "narHash": "sha256-b/exDDQSLmENZZgbAEI3qi9yHkuXAXCPbormD8CSJXo=", + "lastModified": 1744633460, + "narHash": "sha256-fbWE4Xpw6eH0Q6in+ymNuDwTkqmFmtxcQEmtRuKDTTk=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "de6fc5551121c59c01e2a3d45b277a6d05077bc4", + "rev": "9a049b4a421076d27fee3eec664a18b2066824cb", "type": "github" }, "original": { @@ -90,11 +90,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1743964447, - "narHash": "sha256-nEo1t3Q0F+0jQ36HJfbJtiRU4OI+/0jX/iITURKe3EE=", + "lastModified": 1744463964, + "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", "type": "github" }, "original": { @@ -106,11 +106,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743975612, - "narHash": "sha256-o4FjFOUmjSRMK7dn0TFdAT0RRWUWD+WsspPHa+qEQT8=", + "lastModified": 1744440957, + "narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a880f49904d68b5e53338d1e8c7bf80f59903928", + "rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d", "type": "github" }, "original": { From 85399a53b546b4ea640dc4e8ef32733d9b549256 Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Thu, 17 Apr 2025 22:46:07 +0200 Subject: [PATCH 2/8] add parsec --- modules/software/flatpak.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/software/flatpak.nix b/modules/software/flatpak.nix index c18767a..968a64f 100644 --- a/modules/software/flatpak.nix +++ b/modules/software/flatpak.nix @@ -25,6 +25,10 @@ origin = "flathub"; appId = "md.obsidian.Obsidian"; } # note taking and brain organising + { + origin = "flathub"; + appId = "com.parsecgaming.parsec"; + } # remote dekstop # messenger { From 9f91bd342eec88568b25a564c546b57420f392fa Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Thu, 17 Apr 2025 22:46:41 +0200 Subject: [PATCH 3/8] add comma --- modules/software/nix-helper/index.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/software/nix-helper/index.nix b/modules/software/nix-helper/index.nix index 9eabaa3..e4b63d2 100644 --- a/modules/software/nix-helper/index.nix +++ b/modules/software/nix-helper/index.nix @@ -4,6 +4,7 @@ environment.systemPackages = with pkgs; [ nix-index + comma ]; programs.nix-index = { From ae7517e9940b6197b1699eb85e3fe1e2b1ff4589 Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Thu, 17 Apr 2025 22:47:05 +0200 Subject: [PATCH 4/8] add sops --- modules/software/packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/software/packages.nix b/modules/software/packages.nix index 139d933..e61aa94 100644 --- a/modules/software/packages.nix +++ b/modules/software/packages.nix @@ -42,6 +42,7 @@ home-manager dfc p7zip + sops # move to homemanager? unstable.mumble From 7f094b80c5b4496485c81b4e6b3d0e1f659d9036 Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Thu, 17 Apr 2025 22:48:09 +0200 Subject: [PATCH 5/8] refactor and add jitsi --- flake.nix | 56 +++---------------- hosts/crocoite/{crocoite.nix => default.nix} | 0 hosts/jitsi/default.nix | 58 ++++++++++++++++++++ hosts/jitsi/hardware-configuration.nix | 6 ++ 4 files changed, 72 insertions(+), 48 deletions(-) rename hosts/crocoite/{crocoite.nix => default.nix} (100%) create mode 100644 hosts/jitsi/default.nix create mode 100644 hosts/jitsi/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index b58165f..3a4de7d 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,7 @@ } @ inputs: let # Supported systems for your flake packages, shell, etc. systems = [ - "aarch64-linux" + #"aarch64-linux" "x86_64-linux" ]; @@ -53,9 +53,9 @@ host_helper = hostname: { ${hostname} = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;} // {inherit nixos-unstable;}; + specialArgs = {inherit inputs;}; modules = [ - ./hosts/${hostname}/${hostname}.nix + ./hosts/${hostname} ]; }; }; @@ -63,64 +63,24 @@ # Your custom packages # Accessible through 'nix build', 'nix shell', etc #packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + # Formatter for your nix files, available through 'nix fmt' # Other options beside 'alejandra' include 'nixpkgs-fmt' formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); # Your custom packages and modifications, exported as overlays overlays = import ./overlays {inherit inputs;}; + # Reusable nixos modules you might want to export # These are usually stuff you would upstream into nixpkgs #nixosModules = import ./modules/nixos; - # Reusable home-manager modules you might want to export - # These are usually stuff you would upstream into home-manager - #homeManagerModules = import ./modules/home-manager; # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' + # to add more append // (host_helper example); nixosConfigurations = - host_helper "crocoite"; # // (host_helper example); + host_helper "crocoite" // + host_helper "jitsi"; - ## Standalone home-manager configuration entrypoint - ## Available through 'home-manager --flake .#your-username@your-hostname' - #homeConfigurations = { - # # FIXME replace with your username@hostname - # "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration { - # pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance - # extraSpecialArgs = {inherit inputs;}; - # modules = [ - # # > Our main home-manager configuration file < - # ./home-manager/home.nix - # ]; - # }; - #}; - - packages.x86_64-linux = { - factorio = nixos-generators.nixosGenerate { - system = "x86_64-linux"; - modules = [ - # you can include your own nixos configuration here, i.e. - ./hosts/factorio/factorio.nix - ]; - - customFormats = { - "myFormat" = { - lib, - modulesPath, - ... - }: { - imports = [ - "${toString modulesPath}/virtualisation/proxmox-lxc.nix" - ]; - boot.loader.grub.enable = lib.mkForce false; - boot.loader.systemd-boot.enable = lib.mkForce false; - formatAttr = "tarball"; - fileExtension = "asd.tar.xz"; - }; - }; - format = "myFormat"; - #format = "vmware"; - }; - }; }; } diff --git a/hosts/crocoite/crocoite.nix b/hosts/crocoite/default.nix similarity index 100% rename from hosts/crocoite/crocoite.nix rename to hosts/crocoite/default.nix diff --git a/hosts/jitsi/default.nix b/hosts/jitsi/default.nix new file mode 100644 index 0000000..98a16ab --- /dev/null +++ b/hosts/jitsi/default.nix @@ -0,0 +1,58 @@ +{ + pkgs, + lib, + modulesPath, + ... +}: { + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? + + nixpkgs.config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + nix.settings.experimental-features = ["nix-command" "flakes"]; + + # https://lix.systems/ Lix is a modern, delicious implementation of the Nix package manager, + # focused on correctness, usability, and growth – + # and committed to doing right by its community. + nix.package = pkgs.lix; + + imports = [ + #nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 + #./hardware-configuration.nix + #./boot.nix + #./hardware-configuration.nix + + ../../modules/locale.nix + #../../modules/game/server/factorio/factorio.nix + + (modulesPath + "/profiles/perlless.nix") + (modulesPath + "/profiles/minimal.nix") + { + environment.defaultPackages = []; + boot.kernel.enable = false; + boot.isContainer = true; + nixpkgs.overlays = [(self: super: {})]; + } + { + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + } + ]; + disabledModules = [ + (modulesPath + "/profiles/all-hardware.nix") + (modulesPath + "/profiles/base.nix") + # + # + ]; +} diff --git a/hosts/jitsi/hardware-configuration.nix b/hosts/jitsi/hardware-configuration.nix new file mode 100644 index 0000000..1a421a1 --- /dev/null +++ b/hosts/jitsi/hardware-configuration.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} From dc411c006e1c52e7676ebd55e331fda52956da5e Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Mon, 28 Apr 2025 17:05:06 +0200 Subject: [PATCH 6/8] feat: split off outputs --- flake.nix | 60 +------------------------------------- hostHelper.nix | 9 ++++++ hosts/crocoite/default.nix | 8 ++--- outputs.nix | 36 +++++++++++++++++++++++ overlays/default.nix | 4 +-- 5 files changed, 52 insertions(+), 65 deletions(-) create mode 100644 hostHelper.nix create mode 100644 outputs.nix diff --git a/flake.nix b/flake.nix index 3a4de7d..eea0daf 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,5 @@ { - ###### inputs = { - ###### - #nixpkgs-old.url = "github:NixOS/nixpkgs/nixos-24.05"; - # Main nix package repository nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; @@ -28,59 +24,5 @@ nix-flatpak.url = "github:gmodena/nix-flatpak"; }; - ####### - outputs = - ####### - { - self, - nixpkgs, - nixos-hardware, - nixos-unstable, - nix-flatpak, - home-manager, - nixos-generators, - ... - } @ inputs: let - # Supported systems for your flake packages, shell, etc. - systems = [ - #"aarch64-linux" - "x86_64-linux" - ]; - - # This is a function that generates an attribute by calling a function you - # pass to it, with each system as an argument - forAllSystems = nixpkgs.lib.genAttrs systems; - - host_helper = hostname: { - ${hostname} = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/${hostname} - ]; - }; - }; - in { - # Your custom packages - # Accessible through 'nix build', 'nix shell', etc - #packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); - - # Formatter for your nix files, available through 'nix fmt' - # Other options beside 'alejandra' include 'nixpkgs-fmt' - formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); - - # Your custom packages and modifications, exported as overlays - overlays = import ./overlays {inherit inputs;}; - - # Reusable nixos modules you might want to export - # These are usually stuff you would upstream into nixpkgs - #nixosModules = import ./modules/nixos; - - # NixOS configuration entrypoint - # Available through 'nixos-rebuild --flake .#your-hostname' - # to add more append // (host_helper example); - nixosConfigurations = - host_helper "crocoite" // - host_helper "jitsi"; - - }; + outputs = {...}@inArgs: import ./outputs.nix inArgs; } diff --git a/hostHelper.nix b/hostHelper.nix new file mode 100644 index 0000000..500d93b --- /dev/null +++ b/hostHelper.nix @@ -0,0 +1,9 @@ +inArgs: hostname: { + ${hostname} = inArgs.nixpkgs.lib.nixosSystem { + specialArgs = {inherit inArgs;}; + modules = [ + {networking.hostName = hostname;} + (./hosts/${hostname}) + ]; + }; +} diff --git a/hosts/crocoite/default.nix b/hosts/crocoite/default.nix index 40e6bdf..1929622 100644 --- a/hosts/crocoite/default.nix +++ b/hosts/crocoite/default.nix @@ -1,11 +1,11 @@ { pkgs, - inputs, + inArgs, modulesPath, nixos-unstable, ... }: { - networking.hostName = "crocoite"; # Define your hostname. + #networking.hostName = "crocoite"; # Define your hostname. # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions @@ -18,7 +18,7 @@ #nixpkgs.overlays = [ overlays.unstable-packages ]; nixpkgs = { # You can add overlays here - overlays = with inputs.self.overlays; [ + overlays = with inArgs.self.overlays; [ # Add overlays your own flake exports (from overlays and pkgs dir): #additions #modifications @@ -56,7 +56,7 @@ # steam and other stuff seems to depend on perl #"${modulesPath}/profiles/perlless.nix" - inputs.nix-flatpak.nixosModules.nix-flatpak + inArgs.nix-flatpak.nixosModules.nix-flatpak #nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 ./hardware-configuration.nix diff --git a/outputs.nix b/outputs.nix new file mode 100644 index 0000000..54c4152 --- /dev/null +++ b/outputs.nix @@ -0,0 +1,36 @@ +inArgs: let + # Supported systems for your flake packages, shell, etc. + systems = [ + #"aarch64-linux" + "x86_64-linux" + ]; + + # This is a function that generates an attribute by calling a function you + # pass to it, with each system as an argument + forAllSystems = inArgs.nixpkgs.lib.genAttrs systems; + + hostHelper = import ./hostHelper.nix inArgs; + +in { + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#your-hostname' + # to add more append // (host_helper example); + + nixosConfigurations = + (hostHelper "crocoite"); #// (host_helper2 "jitsi"); + + # Your custom packages + # Accessible through 'nix build', 'nix shell', etc + #packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + + # Your custom packages and modifications, exported as overlays + overlays = import ./overlays {inherit inArgs;}; + + # Reusable nixos modules you might want to export + # These are usually stuff you would upstream into nixpkgs + #nixosModules = import ./modules/nixos; + + # Formatter for your nix files, available through 'nix fmt' + # Other options beside 'alejandra' include 'nixpkgs-fmt' + formatter = forAllSystems (system: inArgs.nixpkgs.legacyPackages.${system}.alejandra); +} diff --git a/overlays/default.nix b/overlays/default.nix index 69e7d0e..b650538 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,5 @@ # This file defines overlays -{inputs, ...}: { +{inArgs, ...}: { # This one brings our custom packages from the 'pkgs' directory additions = final: _prev: import ../pkgs final.pkgs; @@ -15,7 +15,7 @@ # When applied, the unstable nixpkgs set (declared in the flake inputs) will # be accessible through 'pkgs.unstable' unstable-packages = final: _prev: { - unstable = import inputs.nixos-unstable { + unstable = import inArgs.nixos-unstable { system = final.system; config.allowUnfree = true; }; From 8198028612f931281922285194cd555c82d333c4 Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Mon, 28 Apr 2025 17:06:04 +0200 Subject: [PATCH 7/8] feat: add prusa-slicer --- modules/software/packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/software/packages.nix b/modules/software/packages.nix index e61aa94..2642393 100644 --- a/modules/software/packages.nix +++ b/modules/software/packages.nix @@ -59,6 +59,6 @@ element-desktop rustdesk-flutter timer - prusa-slicer + unstable.prusa-slicer ]; } From dbb0d71b2b230b65bda23ae6032222a00d8e681e Mon Sep 17 00:00:00 2001 From: Ranomier <> Date: Mon, 28 Apr 2025 17:06:18 +0200 Subject: [PATCH 8/8] wip: jitsi --- hosts/jitsi/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hosts/jitsi/default.nix b/hosts/jitsi/default.nix index 98a16ab..326fe5c 100644 --- a/hosts/jitsi/default.nix +++ b/hosts/jitsi/default.nix @@ -4,6 +4,7 @@ modulesPath, ... }: { + #networking.hostName = "jitsi"; # Define your hostname. # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave @@ -24,13 +25,9 @@ nix.package = pkgs.lix; imports = [ - #nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 - #./hardware-configuration.nix - #./boot.nix - #./hardware-configuration.nix + ./hardware-configuration.nix ../../modules/locale.nix - #../../modules/game/server/factorio/factorio.nix (modulesPath + "/profiles/perlless.nix") (modulesPath + "/profiles/minimal.nix")