From c479f8a7b8cfb8c2bc6fca7565e3ac52ba3584c3 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Thu, 16 Dec 2021 18:05:07 -0300 Subject: [PATCH] some better comments --- configuration.nix | 29 ++++++++++++++++++++++++----- home.nix | 15 ++++++++++++++- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/configuration.nix b/configuration.nix index 2832aa1..3397428 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,13 +1,24 @@ -{ inputs, pkgs, ... }: { +# This is your system's configuration file. + +{ inputs, lib, config, pkgs, ... }: { imports = [ - # Add external nixos modules here + # 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). + + # Import your generated hardware configuration ./hardware-configuration.nix + + # Feel free to split up your configuration and import pieces of it here. ]; - system.stateVersion = "21.11"; - # Uncomment to enable unfree packages for your system - # nixpkgs.config.allowUnfree = true; + # Set your hostname + networking.hostName = "cool-computer"; + + # Comment out to disable unfree packages for your system + nixpkgs.config.allowUnfree = true; # This will make all users source .nix-profile on login, activating home # manager automatically. Will allow you to use home-manager standalone on @@ -15,4 +26,12 @@ environment.loginShellInit = '' [ -d "$HOME/.nix-profile" ] || /nix/var/nix/profiles/per-user/$USER/home-manager/activate &> /dev/null ''; + + # This will add your inputs as registries, making operations with them + # consistent with your flake inputs. + nix.registry = lib.mapAttrs' (n: v: + lib.nameValuePair ("${n}") ({ flake = inputs."${n}"; }) + ) inputs; + + system.stateVersion = "21.11"; } diff --git a/home.nix b/home.nix index 5a7cb57..27703cc 100644 --- a/home.nix +++ b/home.nix @@ -1,8 +1,21 @@ { inputs, pkgs, hostname, ... }: { imports = [ - # Add external home-manager modules here + # If you want to use home-manager modules from other flakes (such as nix-colors), use something like: + # inputs.nix-colors.nixosModule + + # Feel free to split up your configuration and import pieces of it here. ]; + # Comment out to disable unfree packages for your system + nixpkgs.config.allowUnfree = true; + # Add stuff for your user as you see fit: # programs.neovim.enable = true; + + # 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"; }