Abstract more common expressions to be reused, move lazygit settings into dedicated file

This commit is contained in:
Evie Litherland-Smith 2023-03-29 07:37:34 +01:00
parent 84d4d49666
commit d8f600ab43
14 changed files with 138 additions and 227 deletions

View file

@ -1,70 +1,15 @@
{ config, pkgs, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
in
{
imports = [
./common.nix
./packages.nix
(import "${home-manager}/nixos")
./common/common.nix
./common/en_GB.nix
./common/plasma.nix
./common/desktop.nix
];
networking.hostName = "H0615"; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "gb";
xkbVariant = "";
};
# Configure console keymap
console.keyMap = "uk";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Define a user account. Don't forget to set a password with passwd.
users.users.elitherl = {
isNormalUser = true;
@ -76,32 +21,8 @@ in
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "elitherl";
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Set up home manager for user
home-manager.users.elitherl = import ./home/H0615-elitherl.nix;
home-manager.useUserPackages = false;
home-manager.useGlobalPkgs = false;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 22 ];
# networking.firewall.allowedUDPPorts = [ 22 ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
home-manager.users.elitherl = import ./home-H0615-elitherl.nix;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@ -110,9 +31,4 @@ in
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
system.autoUpgrade = {
enable = true;
};
}

View file

@ -1,9 +0,0 @@
{ config, pkgs, ... }:
{
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
}

37
nixos/common/common.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, pkgs, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
in
{
imports = [
(import "${home-manager}/nixos")
];
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [ ];
home-manager.useUserPackages = false;
home-manager.useGlobalPkgs = false;
# Enable networking
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable the OpenSSH daemon.
services.openssh.enable = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
system.autoUpgrade = {
enable = true;
allowReboot = false;
};
}

16
nixos/common/desktop.nix Normal file
View file

@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

20
nixos/common/en_GB.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, pkgs, ... }:
{
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
}

18
nixos/common/plasma.nix Normal file
View file

@ -0,0 +1,18 @@
{config, pkgs, ...}:
{
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "gb";
xkbVariant = "";
};
# Configure console keymap
console.keyMap = "uk";
}

View file

@ -1,9 +1,9 @@
{ pkgs, ... }: {
imports = [
./common.nix
./dev.nix
./nomachine.nix
./python310.nix
./home/common.nix
./home/dev.nix
./home/nomachine.nix
./home/python310.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
@ -12,7 +12,6 @@
home.packages = with pkgs; [
microsoft-edge
bitwarden
];
programs.git = {

View file

@ -1,11 +1,11 @@
{ pkgs, ... }: {
imports = [
./common.nix
./gaming.nix
./messaging.nix
./dev.nix
./nomachine.nix
./python310.nix
./home/common.nix
./home/gaming.nix
./home/messaging.nix
./home/dev.nix
./home/nomachine.nix
./home/python310.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
@ -16,7 +16,6 @@
home.packages = with pkgs; [
firefox
bitwarden
];
programs.git = {

View file

@ -29,5 +29,6 @@
home.packages = with pkgs; [
wezterm
bitwarden
];
}

View file

@ -9,32 +9,11 @@
git
gcc
gnumake
lazygit
direnv
];
programs.lazygit = {
enable = true;
settings = {
gui = {
showFileTree = true;
showCommandLog = false;
showIcons = true;
theme = {
lightTheme = false;
activeBorderColor = [ "#a6da95" "bold" ];
inactiveBorderColor = [ "#cad3f5" ];
optionsTextColor = [ "#8aadf4" ];
selectedLineBgColor = [ "#363a4f" ];
selectedRangeBgColor = [ "#363a4f" ];
cherryPickedCommitBgColor = [ "#8bd5ca" ];
cherryPickedCommitFgColor = [ "#8aadf4" ];
unstagedChangesColor = [ "red" ];
};
};
update.method = "never";
promptToReturnFromSubprocess = false;
notARepository = "quit";
};
settings = import ./settings/lazygit.nix;
};
}

View file

@ -2,6 +2,8 @@
{
home.packages = with pkgs; [
mesa
steam
steam-run
];
}

View file

@ -0,0 +1,21 @@
{
gui = {
showFileTree = true;
showCommandLog = false;
showIcons = true;
theme = {
lightTheme = false;
activeBorderColor = [ "#a6da95" "bold" ];
inactiveBorderColor = [ "#cad3f5" ];
optionsTextColor = [ "#8aadf4" ];
selectedLineBgColor = [ "#363a4f" ];
selectedRangeBgColor = [ "#363a4f" ];
cherryPickedCommitBgColor = [ "#8bd5ca" ];
cherryPickedCommitFgColor = [ "#8aadf4" ];
unstagedChangesColor = [ "red" ];
};
};
update.method = "never";
promptToReturnFromSubprocess = false;
notARepository = "quit";
}

View file

@ -1,7 +0,0 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
home-manager
];
}

View file

@ -1,70 +1,15 @@
{ config, pkgs, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz";
in
{
imports = [
./common.nix
./packages.nix
(import "${home-manager}/nixos")
./common/common.nix
./common/en_GB.nix
./common/plasma.nix
./common/desktop.nix
];
networking.hostName = "Vanguard"; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "gb";
xkbVariant = "";
};
# Configure console keymap
console.keyMap = "uk";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Define a user account. Don't forget to set a password with passwd.
users.users.xenia = {
isNormalUser = true;
@ -76,32 +21,11 @@ in
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "xenia";
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Set up home manager for user
home-manager.users.xenia = import ./home/vanguard-xenia.nix;
home-manager.useUserPackages = false;
home-manager.useGlobalPkgs = false;
home-manager.users.xenia = import ./home-vanguard-xenia.nix;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 22 ];
# networking.firewall.allowedUDPPorts = [ 22 ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# For Steam support
hardware.opengl.driSupport32Bit = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@ -110,9 +34,4 @@ in
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
system.autoUpgrade = {
enable = true;
};
}