From c3b54c538f3dc1195c7459177a7c215046f45ec3 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:42:22 +0200 Subject: [PATCH] update --- docs/src/README_template.md | 10 +++++----- flake.nix | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/docs/src/README_template.md b/docs/src/README_template.md index 6e32b9b..8892e6d 100644 --- a/docs/src/README_template.md +++ b/docs/src/README_template.md @@ -19,7 +19,7 @@ It's a simple way to manage your system configuration and dotfiles. - 🏠 `home` are the dotfiles and configuration files for the user - 💻 `hosts` are the system configuration files - 'laptop' is my own configuration for my laptop with nvidia - - 'server' is for my nixos server (w/nextcloud, nginx, vaultwarden, ...) + - 'server' is for my nixos server (w/nextcloud, nginx, vaultwarden, ... look `hosts/modules/server`) - 'guest' is a *template* that you can copy and modify for *your own system* - 'themes' contains all the *themes* available (see [THEMES.md](docs/THEMES.md)) - 'modules' are some nix modules that you can import (nvidia, prime, fonts, ...) @@ -31,12 +31,12 @@ It's a simple way to manage your system configuration and dotfiles. git clone https://github.com/anotherhadi/nixy ~/.config/nixos ``` -- Copy the `hosts/guest` folder and rename it to your system name - - Change the variables inside your new hosts -.. +- Copy the `hosts/guest` folder, rename it to your system name and change the variables inside the `variables.nix` file +- Add your `hardware-configuration.nix` to your new hosts folder +- Add your 'nixosConfigurations' inside `flake.nix` (You can edit the "yourhostname" one and change the lines containing #CHANGEME) ```sh -sudo nixos-rebuild switch --flake ~/.config/nixos#nixy +sudo nixos-rebuild switch --flake ~/.config/nixos#your_hostname ``` ## Documentation diff --git a/flake.nix b/flake.nix index d5c5c6e..44e1ab1 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - users."hadi" = import ./home/laptop.nix; # CHANGE ME + users."hadi" = import ./home/laptop.nix; extraSpecialArgs = { inherit inputs; }; }; } @@ -59,7 +59,25 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - users."hadi" = import ./home/server.nix; # CHANGE ME + users."hadi" = import ./home/server.nix; + extraSpecialArgs = { inherit inputs; }; + }; + } + ]; + }; + + yourhostname = nixpkgs.lib.nixosSystem { #CHANGEME + system = "x86_64-linux"; + modules = [ + ./hosts/yourhostname/configuration.nix #CHANGEME + inputs.home-manager.nixosModules.home-manager + { + nixpkgs.overlays = [ nur.overlay ]; + _module.args = { inherit inputs; }; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users."yourusername" = import ./home/laptop.nix; #CHANGEME extraSpecialArgs = { inherit inputs; }; }; }