diff --git a/flake.nix b/flake.nix index 925ae62..92e2789 100644 --- a/flake.nix +++ b/flake.nix @@ -30,12 +30,13 @@ system = "x86_64-linux"; commonModules = hostname: [ + ./modules/system ./modules/sops.nix - ./modules/system.nix ./modules/gnome.nix ./modules/syncthing ./modules/stylix.nix ./hosts/${hostname} + sops-nix.nixosModules.sops stylix.nixosModules.stylix home-manager.nixosModules.home-manager diff --git a/home/base/gnome/default.nix b/home/base/gnome/default.nix index 4a29910..bf16521 100644 --- a/home/base/gnome/default.nix +++ b/home/base/gnome/default.nix @@ -17,17 +17,5 @@ home.packages = with pkgs.gnomeExtensions; [ 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"; - }; - }; } diff --git a/home/base/shell/fish.nix b/home/base/shell/fish.nix index ea6df80..68cc18d 100644 --- a/home/base/shell/fish.nix +++ b/home/base/shell/fish.nix @@ -20,6 +20,17 @@ in 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"; } diff --git a/modules/system.nix b/modules/system.nix deleted file mode 100644 index 10cc524..0000000 --- a/modules/system.nix +++ /dev/null @@ -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. It‘s 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" ]; -} diff --git a/modules/system/boot.nix b/modules/system/boot.nix new file mode 100644 index 0000000..26825a0 --- /dev/null +++ b/modules/system/boot.nix @@ -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" + ]; + }; +} diff --git a/modules/system/core.nix b/modules/system/core.nix new file mode 100644 index 0000000..e2a2e43 --- /dev/null +++ b/modules/system/core.nix @@ -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" ]; +} diff --git a/modules/system/default.nix b/modules/system/default.nix new file mode 100644 index 0000000..be424dc --- /dev/null +++ b/modules/system/default.nix @@ -0,0 +1,12 @@ +{ ... }: { + + imports = [ + ./core.nix + ./boot.nix + ./locale.nix + ./packages.nix + ./printing.nix + ./misc.nix + ./nh.nix + ]; +} diff --git a/modules/system/locale.nix b/modules/system/locale.nix new file mode 100644 index 0000000..c25c500 --- /dev/null +++ b/modules/system/locale.nix @@ -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"; + }; + +} diff --git a/modules/system/misc.nix b/modules/system/misc.nix new file mode 100644 index 0000000..a5239e5 --- /dev/null +++ b/modules/system/misc.nix @@ -0,0 +1,11 @@ +{ ... }: + +{ + # fix direnv integration with fish + environment.pathsToLink = [ "/share/fish" ]; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; +} diff --git a/modules/system/nh.nix b/modules/system/nh.nix new file mode 100644 index 0000000..160fc43 --- /dev/null +++ b/modules/system/nh.nix @@ -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"; + }; + +} diff --git a/modules/system/packages.nix b/modules/system/packages.nix new file mode 100644 index 0000000..25c4f65 --- /dev/null +++ b/modules/system/packages.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + vim + git + wget + curl + tree + python3 + lm_sensors + ]; +} diff --git a/modules/system/printing.nix b/modules/system/printing.nix new file mode 100644 index 0000000..82d674c --- /dev/null +++ b/modules/system/printing.nix @@ -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 ]; +}