modularize modules/system.nix, remove gnome-terminal

This commit is contained in:
Anthony Rodriguez 2024-08-27 13:22:17 +02:00
parent dd434b351f
commit 255496f601
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
12 changed files with 169 additions and 158 deletions

View file

@ -30,12 +30,13 @@
system = "x86_64-linux"; system = "x86_64-linux";
commonModules = hostname: [ commonModules = hostname: [
./modules/system
./modules/sops.nix ./modules/sops.nix
./modules/system.nix
./modules/gnome.nix ./modules/gnome.nix
./modules/syncthing ./modules/syncthing
./modules/stylix.nix ./modules/stylix.nix
./hosts/${hostname} ./hosts/${hostname}
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
stylix.nixosModules.stylix stylix.nixosModules.stylix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager

View file

@ -17,17 +17,5 @@
home.packages = with pkgs.gnomeExtensions; [ home.packages = with pkgs.gnomeExtensions; [
appindicator appindicator
]; ];
programs.gnome-terminal = {
enable = true;
showMenubar = false;
profile."2e695b31-b387-4c21-84db-6203b9d8cf52" = {
visibleName = "nezia";
default = true;
audibleBell = false;
boldIsBright = true;
font = "MonaspiceNe Nerd Font 14";
};
};
} }

View file

@ -20,6 +20,17 @@ in
plugins = [ { name = "fzf"; src = pkgs.fishPlugins.fzf.src; } ]; plugins = [ { name = "fzf"; src = pkgs.fishPlugins.fzf.src; } ];
}; };
programs.bash = {
enable = true;
initExtra = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
xdg.configFile."fish/themes/Catppuccin Frappe.theme".source = "${catppuccin-fish}/themes/Catppuccin Frappe.theme"; xdg.configFile."fish/themes/Catppuccin Frappe.theme".source = "${catppuccin-fish}/themes/Catppuccin Frappe.theme";
} }

View file

@ -1,145 +0,0 @@
{ pkgs, hostname, username, lib, ... }: {
networking.hostName = hostname;
boot = {
loader = {
timeout = 0;
systemd-boot = {
enable = true;
consoleMode = "2";
};
efi.canTouchEfiVariables = true;
};
plymouth = {
enable = true;
extraConfig = ''
[Daemon]
DeviceScale=2
'';
};
consoleLogLevel = 0;
initrd.systemd.enable = true;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"loglevel=3"
"rd.systemd.show_status=false"
"rd.udev.log_level=3"
"udev.log_priority=3"
];
};
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Paris";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_CH.UTF-8";
LC_IDENTIFICATION = "fr_CH.UTF-8";
LC_MEASUREMENT = "fr_CH.UTF-8";
LC_MONETARY = "fr_CH.UTF-8";
LC_NAME = "fr_CH.UTF-8";
LC_NUMERIC = "fr_CH.UTF-8";
LC_PAPER = "fr_CH.UTF-8";
LC_TELEPHONE = "fr_CH.UTF-8";
LC_TIME = "fr_CH.UTF-8";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.nezia = {
isNormalUser = true;
description = "Anthony Rodriguez";
extraGroups = [ "networkmanager" "wheel" ];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
git
wget
curl
tree
python3
lm_sensors
];
# fix direnv integration with fish
environment.pathsToLink = [ "/share/fish" ];
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
# setup printing service
services.printing.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
services.printing.drivers = [ pkgs.gutenprint pkgs.hplip ];
hardware.sane.enable = true; # enables support for SANE scanners
hardware.sane.extraBackends = [
pkgs.sane-airscan # generic
pkgs.hplip # HP
pkgs.epkowa # Epson
pkgs.utsushi # other printers
];
services.udev.packages = [ pkgs.sane-airscan pkgs.utsushi ];
services.udisks2.enable = true;
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
};
environment.sessionVariables = {
FLAKE = "/home/${username}/.dotfiles";
};
# Enable all packages
nixpkgs.config.allowUnfree = true;
hardware.enableAllFirmware = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# 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 = "24.05"; # Did you read the comment?
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

34
modules/system/boot.nix Normal file
View file

@ -0,0 +1,34 @@
{ ... }:
{
boot = {
loader = {
timeout = 0;
systemd-boot = {
enable = true;
consoleMode = "2";
};
efi.canTouchEfiVariables = true;
};
plymouth = {
enable = true;
extraConfig = ''
[Daemon]
DeviceScale=2
'';
};
consoleLogLevel = 0;
initrd.systemd.enable = true;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"loglevel=3"
"rd.systemd.show_status=false"
"rd.udev.log_level=3"
"udev.log_priority=3"
];
};
}

27
modules/system/core.nix Normal file
View file

@ -0,0 +1,27 @@
{ hostname, ... }:
{
networking.hostName = hostname;
networking.networkmanager.enable = true;
services.xserver.xkb = {
layout = "us";
variant = "";
};
users.users.nezia = {
isNormalUser = true;
description = "Anthony Rodriguez";
extraGroups = [ "networkmanager" "wheel" ];
};
# automount
services.udisks2.enable = true;
nixpkgs.config.allowUnfree = true;
hardware.enableAllFirmware = true;
system.stateVersion = "24.05";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View file

@ -0,0 +1,12 @@
{ ... }: {
imports = [
./core.nix
./boot.nix
./locale.nix
./packages.nix
./printing.nix
./misc.nix
./nh.nix
];
}

22
modules/system/locale.nix Normal file
View file

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

11
modules/system/misc.nix Normal file
View file

@ -0,0 +1,11 @@
{ ... }:
{
# fix direnv integration with fish
environment.pathsToLink = [ "/share/fish" ];
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
}

14
modules/system/nh.nix Normal file
View file

@ -0,0 +1,14 @@
{ username, ... }:
{
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
};
environment.sessionVariables = {
FLAKE = "/home/${username}/.dotfiles";
};
}

View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vim
git
wget
curl
tree
python3
lm_sensors
];
}

View file

@ -0,0 +1,23 @@
{ pkgs, ... }:
{
# setup printing service
services.printing.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
services.printing.drivers = [ pkgs.gutenprint pkgs.hplip ];
hardware.sane.enable = true; # enables support for SANE scanners
hardware.sane.extraBackends = [
pkgs.sane-airscan # generic
pkgs.hplip # HP
pkgs.epkowa # Epson
pkgs.utsushi # other printers
];
services.udev.packages = [ pkgs.sane-airscan pkgs.utsushi ];
}