From 689e1cd6427fad667eac95814a94114d6ae01041 Mon Sep 17 00:00:00 2001 From: Tasia Iso Date: Sat, 13 Apr 2024 15:58:42 +0200 Subject: [PATCH] uhhhh --- flake.lock | 60 ++++++++++++------------------- flake.nix | 45 ++++++------------------ hosts/README.md | 17 +++++++++ hosts/enry/configuration.nix | 2 +- hosts/pc/home.nix | 68 ------------------------------------ hosts/phoenix/home.nix | 68 ------------------------------------ hosts/stuff/home.nix | 68 ------------------------------------ 7 files changed, 50 insertions(+), 278 deletions(-) create mode 100644 hosts/README.md delete mode 100644 hosts/pc/home.nix delete mode 100644 hosts/phoenix/home.nix delete mode 100644 hosts/stuff/home.nix diff --git a/flake.lock b/flake.lock index ca41588..b60531e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,38 +1,6 @@ { "nodes": { - "home-manager": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1712386041, - "narHash": "sha256-dA82pOMQNnCJMAsPG7AXG35VmCSMZsJHTFlTHizpKWQ=", - "path": "/nix/store/9613fxrf433y10fz18ccixj4zpmdibzq-source", - "rev": "d6bb9f934f2870e5cbc5b94c79e9db22246141ff", - "type": "path" - }, - "original": { - "id": "home-manager", - "type": "indirect" - } - }, "nixpkgs": { - "locked": { - "lastModified": 1705331948, - "narHash": "sha256-qjQXfvrAT1/RKDFAMdl8Hw3m4tLVvMCc8fMqzJv0pP4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b8dd8be3c790215716e7c12b247f45ca525867e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { "locked": { "lastModified": 1712791164, "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", @@ -48,7 +16,14 @@ "type": "github" } }, - "nixpkgs_2": { + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "stable": "stable", + "unstable": "unstable" + } + }, + "stable": { "locked": { "lastModified": 1712867921, "narHash": "sha256-edTFV4KldkCMdViC/rmpJa7oLIU8SE/S35lh/ukC7bg=", @@ -64,11 +39,20 @@ "type": "github" } }, - "root": { - "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2", - "nixpkgs-unstable": "nixpkgs-unstable" + "unstable": { + "locked": { + "lastModified": 1712791164, + "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 9b658c4..472b1ef 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,15 @@ { - description = "Your new nix config"; + description = "My NixOS config"; inputs = { # Nixpkgs - nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + stable.url = "github:nixos/nixpkgs/nixos-23.11"; # You can access packages and modules from different nixpkgs revs # at the same time. Here's an working example: - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Also see the 'unstable-packages' overlay at 'overlays/default.nix'. - # Home manager - # home-manager.url = "github:nix-community/home-manager/release-23.11"; - # home-manager.inputs.nixpkgs.follows = "nixpkgs"; - # TODO: Add any other flake you might need # hardware.url = "github:nixos/nixos-hardware"; @@ -24,8 +21,8 @@ outputs = { self, nixpkgs, - nixpkgs-unstable, - home-manager, + stable, + unstable, ... } @ inputs: let inherit (self) outputs; @@ -50,59 +47,37 @@ # 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 build --flake .#phoenix' nixosConfigurations = { - phoenix = nixpkgs-unstable.lib.nixosSystem { + phoenix = unstable.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/phoenix/configuration.nix ]; }; - pc = nixpkgs-unstable.lib.nixosSystem { + pc = unstable.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/pc/configuration.nix ]; }; - stuff = nixpkgs.lib.nixosSystem { + stuff = stable.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/stuff/configuration.nix ]; }; - enry = nixpkgs.lib.nixosSystem { + enry = stable.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ ./hosts/enry/configuration.nix ]; }; }; - - # Standalone home-manager configuration entrypoint - # Available through 'home-manager --flake .#user@phoenix' - # homeConfigurations = { - # "user@phoenix" = home-manager.lib.homeManagerConfiguration { - # pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance - # extraSpecialArgs = {inherit inputs outputs;}; - # modules = [ - # ./hosts/phoenix/home.nix - # ]; - # }; - # "user@stuff" = home-manager.lib.homeManagerConfiguration { - # pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance - # extraSpecialArgs = {inherit inputs outputs;}; - # modules = [ - # ./hosts/stuff/home.nix - # ]; - # }; - # }; }; } diff --git a/hosts/README.md b/hosts/README.md new file mode 100644 index 0000000..91ddc96 --- /dev/null +++ b/hosts/README.md @@ -0,0 +1,17 @@ +# Hosts + +## enry + +This is my Raspberry Pi 3B+ inside my electrical cabinet. + +## pc + +My main PC. + +## phoenix + +My old laptop. + +## stuff + +A friend's laptop. diff --git a/hosts/enry/configuration.nix b/hosts/enry/configuration.nix index 936d51f..18efa42 100644 --- a/hosts/enry/configuration.nix +++ b/hosts/enry/configuration.nix @@ -35,7 +35,7 @@ extraGroups = ["networkmanager" "wheel" "dialout" "syncthing"]; initialPassword = "correcthorsebatterystaple"; openssh.authorizedKeys.keys = [ - "SHA256:RrcbPCE9BPVLAEhERm81NwXA28OKpn9U6irR2vG7K5I user@phoenix"; + "SHA256:RrcbPCE9BPVLAEhERm81NwXA28OKpn9U6irR2vG7K5I user@phoenix" ]; }; diff --git a/hosts/pc/home.nix b/hosts/pc/home.nix deleted file mode 100644 index de643e7..0000000 --- a/hosts/pc/home.nix +++ /dev/null @@ -1,68 +0,0 @@ -# This is your home-manager configuration file -# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - # You can import other home-manager modules here - imports = [ - # If you want to use modules your own flake exports (from modules/home-manager): - # outputs.homeManagerModules.example - - # Or modules exported from other flakes (such as nix-colors): - # inputs.nix-colors.homeManagerModules.default - - # You can also split up your configuration and import pieces of it here: - # ./nvim.nix - ]; - - nixpkgs = { - # You can add overlays here - overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - - # You can also add overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) - ]; - # Configure your nixpkgs instance - config = { - # Disable if you don't want unfree packages - allowUnfree = true; - # Workaround for https://github.com/nix-community/home-manager/issues/2942 - allowUnfreePredicate = _: true; - }; - }; - - home = { - username = "user"; - homeDirectory = "/home/user"; - }; - - # Add stuff for your user as you see fit: - # programs.neovim.enable = true; - # home.packages = with pkgs; [ steam ]; - - # Enable home-manager and git - programs.home-manager.enable = true; - programs.git.enable = true; - - # Nicely reload system units when changing configs - systemd.user.startServices = "sd-switch"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "23.05"; -} diff --git a/hosts/phoenix/home.nix b/hosts/phoenix/home.nix deleted file mode 100644 index de643e7..0000000 --- a/hosts/phoenix/home.nix +++ /dev/null @@ -1,68 +0,0 @@ -# This is your home-manager configuration file -# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - # You can import other home-manager modules here - imports = [ - # If you want to use modules your own flake exports (from modules/home-manager): - # outputs.homeManagerModules.example - - # Or modules exported from other flakes (such as nix-colors): - # inputs.nix-colors.homeManagerModules.default - - # You can also split up your configuration and import pieces of it here: - # ./nvim.nix - ]; - - nixpkgs = { - # You can add overlays here - overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - - # You can also add overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) - ]; - # Configure your nixpkgs instance - config = { - # Disable if you don't want unfree packages - allowUnfree = true; - # Workaround for https://github.com/nix-community/home-manager/issues/2942 - allowUnfreePredicate = _: true; - }; - }; - - home = { - username = "user"; - homeDirectory = "/home/user"; - }; - - # Add stuff for your user as you see fit: - # programs.neovim.enable = true; - # home.packages = with pkgs; [ steam ]; - - # Enable home-manager and git - programs.home-manager.enable = true; - programs.git.enable = true; - - # Nicely reload system units when changing configs - systemd.user.startServices = "sd-switch"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "23.05"; -} diff --git a/hosts/stuff/home.nix b/hosts/stuff/home.nix deleted file mode 100644 index b859584..0000000 --- a/hosts/stuff/home.nix +++ /dev/null @@ -1,68 +0,0 @@ -# This is your home-manager configuration file -# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - # You can import other home-manager modules here - imports = [ - # If you want to use modules your own flake exports (from modules/home-manager): - # outputs.homeManagerModules.example - - # Or modules exported from other flakes (such as nix-colors): - # inputs.nix-colors.homeManagerModules.default - - # You can also split up your configuration and import pieces of it here: - # ./nvim.nix - ]; - - nixpkgs = { - # You can add overlays here - overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - - # You can also add overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) - ]; - # Configure your nixpkgs instance - config = { - # Disable if you don't want unfree packages - allowUnfree = true; - # Workaround for https://github.com/nix-community/home-manager/issues/2942 - allowUnfreePredicate = _: true; - }; - }; - - home = { - username = "user"; - homeDirectory = "/home/user"; - }; - - # Add stuff for your user as you see fit: - # programs.neovim.enable = true; - # home.packages = with pkgs; [ steam ]; - - # Enable home-manager and git - programs.home-manager.enable = true; - programs.git.enable = true; - - # Nicely reload system units when changing configs - systemd.user.startServices = "sd-switch"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "23.11"; -}