From db27336c16ef38a5c10951fee935887f54253e18 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Thu, 16 Dec 2021 18:36:16 -0300 Subject: [PATCH] couple improvements --- configuration.nix | 12 +++++++----- flake.nix | 29 ++++++++++++++++++++++------- home.nix | 14 ++++++++++---- 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/configuration.nix b/configuration.nix index 3397428..aed4dd0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,12 +1,14 @@ # This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) { inputs, lib, config, pkgs, ... }: { imports = [ # If you want to use modules from other flakes (such as nixos-hardware), use something like: # inputs.hardware.nixosModules.common-cpu-amd # inputs.hardware.nixosModules.common-ssd - # It's extremely recommended you take a look at https://github.com/nixos/nixos-hardware - # and import modules relevant to your hardware (the above examples are for AMD CPUs and SSDs). + # It's strongly recommended you take a look at + # https://github.com/nixos/nixos-hardware + # and import modules relevant to your hardware. # Import your generated hardware configuration ./hardware-configuration.nix @@ -14,10 +16,10 @@ # Feel free to split up your configuration and import pieces of it here. ]; - # Set your hostname + # TODO: Set your hostname networking.hostName = "cool-computer"; - # Comment out to disable unfree packages for your system + # Comment out if you wish to disable unfree packages for your system nixpkgs.config.allowUnfree = true; # This will make all users source .nix-profile on login, activating home @@ -33,5 +35,5 @@ lib.nameValuePair ("${n}") ({ flake = inputs."${n}"; }) ) inputs; - system.stateVersion = "21.11"; + system.stateVersion = "22.05"; } diff --git a/flake.nix b/flake.nix index 0df6429..7d74f9f 100644 --- a/flake.nix +++ b/flake.nix @@ -25,31 +25,46 @@ overlay = (import ./overlays.nix); # This repo's overlay plus any other overlays you use - # If you want to use packages from flakes that are not nixpkgs, add their overlays here. - overlays = [ self.overlay nur.overlay ]; + # If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here. + overlays = [ + self.overlay + # nur.overlay + ]; # System configurations # Accessible via 'nixos-rebuild --flake' nixosConfigurations = { + # TODO: Replace with your hostname cool-computer = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + modules = [ ./configuration.nix + # Adds your overlay and packages to nixpkgs { nixpkgs.overlays = self.overlays; } ]; + # Pass our flake inputs into the config + specialArgs = { inherit inputs; }; }; }; # Home configurations # Accessible via 'home-manager --flake' homeConfigurations = { - "you@cool-computer" = home-manager.lib.homeManagerConfiguration { - system = "x86_64-linux"; + # TODO: Replace with your username@hostname + "you@cool-computer" = home-manager.lib.homeManagerConfiguration rec { + # TODO: Replace with your username username = "you"; - homeDirectory = "/home/you"; + homeDirectory = "/home/${username}"; + system = "x86_64-linux"; + configuration = ./home.nix; - extraModules = [{ nixpkgs.overlays = self.overlays; }]; + extraModules = [ + # Adds your overlay and packages to nixpkgs + { nixpkgs.overlays = self.overlays; } + ]; + # Pass our flake inputs into the config + extraSpecialArgs = { inherit inputs; }; }; }; } diff --git a/home.nix b/home.nix index 27703cc..4aafd76 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,7 @@ -{ inputs, pkgs, hostname, ... }: { +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) + +{ inputs, lib, config, pkgs, ... }: { imports = [ # If you want to use home-manager modules from other flakes (such as nix-colors), use something like: # inputs.nix-colors.nixosModule @@ -6,16 +9,19 @@ # Feel free to split up your configuration and import pieces of it here. ]; - # Comment out to disable unfree packages for your system + # Comment out if you wish to disable unfree packages for your system nixpkgs.config.allowUnfree = true; - # Add stuff for your user as you see fit: + # TODO: 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.users.startServices = "sd-switch"; + systemd.user.startServices = "sd-switch"; + + home.stateVersion = "22.05"; }