couple improvements

This commit is contained in:
Gabriel Fontes 2021-12-16 18:36:16 -03:00
parent c479f8a7b8
commit db27336c16
No known key found for this signature in database
GPG key ID: 2E54EA7BFE630916
3 changed files with 39 additions and 16 deletions

View file

@ -1,12 +1,14 @@
# This is your system's configuration file. # This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{ inputs, lib, config, pkgs, ... }: { { inputs, lib, config, pkgs, ... }: {
imports = [ imports = [
# If you want to use modules from other flakes (such as nixos-hardware), use something like: # 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-cpu-amd
# inputs.hardware.nixosModules.common-ssd # inputs.hardware.nixosModules.common-ssd
# It's extremely recommended you take a look at https://github.com/nixos/nixos-hardware # It's strongly recommended you take a look at
# and import modules relevant to your hardware (the above examples are for AMD CPUs and SSDs). # https://github.com/nixos/nixos-hardware
# and import modules relevant to your hardware.
# Import your generated hardware configuration # Import your generated hardware configuration
./hardware-configuration.nix ./hardware-configuration.nix
@ -14,10 +16,10 @@
# Feel free to split up your configuration and import pieces of it here. # Feel free to split up your configuration and import pieces of it here.
]; ];
# Set your hostname # TODO: Set your hostname
networking.hostName = "cool-computer"; 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; nixpkgs.config.allowUnfree = true;
# This will make all users source .nix-profile on login, activating home # This will make all users source .nix-profile on login, activating home
@ -33,5 +35,5 @@
lib.nameValuePair ("${n}") ({ flake = inputs."${n}"; }) lib.nameValuePair ("${n}") ({ flake = inputs."${n}"; })
) inputs; ) inputs;
system.stateVersion = "21.11"; system.stateVersion = "22.05";
} }

View file

@ -25,31 +25,46 @@
overlay = (import ./overlays.nix); overlay = (import ./overlays.nix);
# This repo's overlay plus any other overlays you use # 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. # If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here.
overlays = [ self.overlay nur.overlay ]; overlays = [
self.overlay
# nur.overlay
];
# System configurations # System configurations
# Accessible via 'nixos-rebuild --flake' # Accessible via 'nixos-rebuild --flake'
nixosConfigurations = { nixosConfigurations = {
# TODO: Replace with your hostname
cool-computer = nixpkgs.lib.nixosSystem { cool-computer = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ modules = [
./configuration.nix ./configuration.nix
# Adds your overlay and packages to nixpkgs
{ nixpkgs.overlays = self.overlays; } { nixpkgs.overlays = self.overlays; }
]; ];
# Pass our flake inputs into the config
specialArgs = { inherit inputs; };
}; };
}; };
# Home configurations # Home configurations
# Accessible via 'home-manager --flake' # Accessible via 'home-manager --flake'
homeConfigurations = { homeConfigurations = {
"you@cool-computer" = home-manager.lib.homeManagerConfiguration { # TODO: Replace with your username@hostname
system = "x86_64-linux"; "you@cool-computer" = home-manager.lib.homeManagerConfiguration rec {
# TODO: Replace with your username
username = "you"; username = "you";
homeDirectory = "/home/you"; homeDirectory = "/home/${username}";
system = "x86_64-linux";
configuration = ./home.nix; 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; };
}; };
}; };
} }

View file

@ -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 = [ imports = [
# If you want to use home-manager modules from other flakes (such as nix-colors), use something like: # If you want to use home-manager modules from other flakes (such as nix-colors), use something like:
# inputs.nix-colors.nixosModule # inputs.nix-colors.nixosModule
@ -6,16 +9,19 @@
# Feel free to split up your configuration and import pieces of it here. # 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; 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; # programs.neovim.enable = true;
# home.packages = with pkgs; [ steam ];
# Enable home-manager and git # Enable home-manager and git
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.git.enable = true; programs.git.enable = true;
# Nicely reload system units when changing configs # Nicely reload system units when changing configs
systemd.users.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
home.stateVersion = "22.05";
} }