diff --git a/flake.lock b/flake.lock index 6628996..1108c56 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1744743431, - "narHash": "sha256-iyn/WBYDc7OtjSawbegINDe/gIkok888kQxk3aVnkgg=", + "lastModified": 1744117652, + "narHash": "sha256-t7dFCDl4vIOOUMhEZnJF15aAzkpaup9x4ZRGToDFYWI=", "owner": "nix-community", "repo": "home-manager", - "rev": "c61bfe3ae692f42ce688b5865fac9e0de58e1387", + "rev": "b4e98224ad1336751a2ac7493967a4c9f6d9cb3f", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nix-flatpak": { "locked": { - "lastModified": 1744659587, - "narHash": "sha256-xJnbmRVte13akgn+Prg06IaRHJ5OX3uVltwsCP/mxoc=", + "lastModified": 1741903049, + "narHash": "sha256-8Y8brH04JjSLrCLvBEbhK9vOu7lhQhqUBW4kI3tifdI=", "owner": "gmodena", "repo": "nix-flatpak", - "rev": "928d868a9141b48f152d3b2b00c433e688d4b106", + "rev": "42c7fb2702219b86a8f5969c3475ce594c28f5d0", "type": "github" }, "original": { @@ -74,11 +74,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1744633460, - "narHash": "sha256-fbWE4Xpw6eH0Q6in+ymNuDwTkqmFmtxcQEmtRuKDTTk=", + "lastModified": 1743420942, + "narHash": "sha256-b/exDDQSLmENZZgbAEI3qi9yHkuXAXCPbormD8CSJXo=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "9a049b4a421076d27fee3eec664a18b2066824cb", + "rev": "de6fc5551121c59c01e2a3d45b277a6d05077bc4", "type": "github" }, "original": { @@ -90,11 +90,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1744463964, - "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", + "lastModified": 1743964447, + "narHash": "sha256-nEo1t3Q0F+0jQ36HJfbJtiRU4OI+/0jX/iITURKe3EE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", + "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", "type": "github" }, "original": { @@ -106,11 +106,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744440957, - "narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=", + "lastModified": 1743975612, + "narHash": "sha256-o4FjFOUmjSRMK7dn0TFdAT0RRWUWD+WsspPHa+qEQT8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d", + "rev": "a880f49904d68b5e53338d1e8c7bf80f59903928", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index eea0daf..b58165f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,9 @@ { + ###### inputs = { + ###### + #nixpkgs-old.url = "github:NixOS/nixpkgs/nixos-24.05"; + # Main nix package repository nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; @@ -24,5 +28,99 @@ nix-flatpak.url = "github:gmodena/nix-flatpak"; }; - outputs = {...}@inArgs: import ./outputs.nix inArgs; + ####### + 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;} // {inherit nixos-unstable;}; + modules = [ + ./hosts/${hostname}/${hostname}.nix + ]; + }; + }; + 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; + # 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' + nixosConfigurations = + host_helper "crocoite"; # // (host_helper example); + + ## 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/hostHelper.nix b/hostHelper.nix deleted file mode 100644 index 500d93b..0000000 --- a/hostHelper.nix +++ /dev/null @@ -1,9 +0,0 @@ -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/crocoite.nix similarity index 93% rename from hosts/crocoite/default.nix rename to hosts/crocoite/crocoite.nix index 1929622..40e6bdf 100644 --- a/hosts/crocoite/default.nix +++ b/hosts/crocoite/crocoite.nix @@ -1,11 +1,11 @@ { pkgs, - inArgs, + inputs, 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 inArgs.self.overlays; [ + overlays = with inputs.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" - inArgs.nix-flatpak.nixosModules.nix-flatpak + inputs.nix-flatpak.nixosModules.nix-flatpak #nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 ./hardware-configuration.nix diff --git a/hosts/jitsi/default.nix b/hosts/jitsi/default.nix deleted file mode 100644 index 326fe5c..0000000 --- a/hosts/jitsi/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - pkgs, - lib, - 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 - # 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 = [ - ./hardware-configuration.nix - - ../../modules/locale.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 deleted file mode 100644 index 1a421a1..0000000 --- a/hosts/jitsi/hardware-configuration.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - lib, - ... -}: { - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/modules/software/flatpak.nix b/modules/software/flatpak.nix index 968a64f..c18767a 100644 --- a/modules/software/flatpak.nix +++ b/modules/software/flatpak.nix @@ -25,10 +25,6 @@ origin = "flathub"; appId = "md.obsidian.Obsidian"; } # note taking and brain organising - { - origin = "flathub"; - appId = "com.parsecgaming.parsec"; - } # remote dekstop # messenger { diff --git a/modules/software/nix-helper/index.nix b/modules/software/nix-helper/index.nix index e4b63d2..9eabaa3 100644 --- a/modules/software/nix-helper/index.nix +++ b/modules/software/nix-helper/index.nix @@ -4,7 +4,6 @@ environment.systemPackages = with pkgs; [ nix-index - comma ]; programs.nix-index = { diff --git a/modules/software/packages.nix b/modules/software/packages.nix index 2642393..139d933 100644 --- a/modules/software/packages.nix +++ b/modules/software/packages.nix @@ -42,7 +42,6 @@ home-manager dfc p7zip - sops # move to homemanager? unstable.mumble @@ -59,6 +58,6 @@ element-desktop rustdesk-flutter timer - unstable.prusa-slicer + prusa-slicer ]; } diff --git a/outputs.nix b/outputs.nix deleted file mode 100644 index 54c4152..0000000 --- a/outputs.nix +++ /dev/null @@ -1,36 +0,0 @@ -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 b650538..69e7d0e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,5 @@ # This file defines overlays -{inArgs, ...}: { +{inputs, ...}: { # 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 inArgs.nixos-unstable { + unstable = import inputs.nixos-unstable { system = final.system; config.allowUnfree = true; };