Format all the files

fresh
Your Name 2024-02-21 22:54:04 +01:00
parent fb78d98640
commit 04dc77e8b9
16 changed files with 365 additions and 383 deletions

View File

@ -16,7 +16,6 @@
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib; lib = nixpkgs.lib;
user = "spagnologasper"; user = "spagnologasper";
hostName = "yoga"; hostName = "yoga";
@ -37,7 +36,7 @@
}; };
} }
]; ];
specialArgs = {inherit inputs user hostName; }; specialArgs = { inherit inputs user hostName; };
}; };
in { in {

View File

@ -1,7 +1,5 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [ ../../modules/nvidia/default.nix ];
../../modules/nvidia/default.nix
];
} }

View File

@ -1,9 +1,7 @@
{ config, lib, inputs, pkgs, ...}: { config, lib, inputs, pkgs, ... }:
{ {
imports = [ imports = [ ../../modules/default.nix ];
../../modules/default.nix
];
config.modules = { config.modules = {
dunst.enable = true; dunst.enable = true;
hyprland.enable = true; hyprland.enable = true;

View File

@ -1,3 +1 @@
inputs: { inputs: { mkSystem = import ./mkSystem.nix inputs; }
mkSystem = import ./mkSystem.nix inputs;
}

View File

@ -1,5 +1,6 @@
{ self, ... } @ inputs: name: system: inputs.nixpkgs.lib.nixosSystem ( { self, ... }@inputs:
{ name: system:
inputs.nixpkgs.lib.nixosSystem ({
inherit system; inherit system;
specialArgs = { inherit inputs self; }; specialArgs = { inherit inputs self; };
modules = [ modules = [
@ -7,5 +8,4 @@
"${self}/hosts/${name}/user.nix" "${self}/hosts/${name}/user.nix"
inputs.home-manager.nixosModule inputs.home-manager.nixosModule
]; ];
} })
)

View File

@ -12,4 +12,4 @@ in {
enableZshIntegration = true; enableZshIntegration = true;
}; };
}; };
} }

View File

@ -6,9 +6,7 @@ let cfg = config.modules.dunst;
in { in {
options.modules.dunst = { enable = mkEnableOption "dunst"; }; options.modules.dunst = { enable = mkEnableOption "dunst"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [ dunst ];
dunst
];
services.dunst = { services.dunst = {
enable = true; enable = true;
@ -25,7 +23,9 @@ in {
idle_threshold = 120; idle_threshold = 120;
font = "FiraCode Nerdfont 12"; font = "FiraCode Nerdfont 12";
line_height = 0; line_height = 0;
format = "<b>%s</b>\n%b"; format = ''
<b>%s</b>
%b'';
alignment = "center"; alignment = "center";
icon_position = "off"; icon_position = "off";
startup_notification = "false"; startup_notification = "false";

View File

@ -4,11 +4,9 @@ with lib;
let cfg = config.modules.fuzzel; let cfg = config.modules.fuzzel;
in { in {
options.modules.fuzzel = {enable = mkEnableOption "fuzzel"; }; options.modules.fuzzel = { enable = mkEnableOption "fuzzel"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [ fuzzel clipman networkmanager_dmenu ];
fuzzel clipman networkmanager_dmenu
];
home.file.".config/fuzzel/fuzzel.ini".source = ./fuzzel.ini; home.file.".config/fuzzel/fuzzel.ini".source = ./fuzzel.ini;
}; };
} }

View File

@ -7,7 +7,9 @@ in {
options.modules.gtk = { enable = mkEnableOption "gtk"; }; options.modules.gtk = { enable = mkEnableOption "gtk"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
dconf gtk-engine-murrine gnome.gnome-themes-extra dconf
gtk-engine-murrine
gnome.gnome-themes-extra
]; ];
home.sessionVariables.GTK_THEME = "Catppuccin-Macchiato-Compact-Mauve-Dark"; home.sessionVariables.GTK_THEME = "Catppuccin-Macchiato-Compact-Mauve-Dark";
gtk = { gtk = {

View File

@ -7,12 +7,19 @@ in {
options.modules.hyprland = { enable = mkEnableOption "hyprland"; }; options.modules.hyprland = { enable = mkEnableOption "hyprland"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
hyprpaper hyprland wl-clipboard hyprland-protocols wlogout swayidle hyprpaper
hyprland
wl-clipboard
hyprland-protocols
wlogout
swayidle
]; ];
home.file.".config/hypr/hyprland.conf".source = ./hyprland.conf; home.file.".config/hypr/hyprland.conf".source = ./hyprland.conf;
home.file.".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf; home.file.".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf;
home.file.".config/hypr/wallpaper.png".source = ../../pictures/wallpaper.png; home.file.".config/hypr/wallpaper.png".source =
home.file.".config/hypr/lock-wallpaper.png".source = ../../pictures/lock-wallpaper.png; ../../pictures/wallpaper.png;
home.file.".config/hypr/lock-wallpaper.png".source =
../../pictures/lock-wallpaper.png;
}; };
} }

View File

@ -6,9 +6,7 @@ let cfg = config.modules.kanshi;
in { in {
options.modules.kanshi = { enable = mkEnableOption "kanshi"; }; options.modules.kanshi = { enable = mkEnableOption "kanshi"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [ kanshi ];
kanshi
];
services.kanshi = { services.kanshi = {
enable = true; enable = true;
@ -137,7 +135,5 @@ in {
}; };
}; };
}; };
} }

View File

@ -6,10 +6,8 @@ let cfg = config.modules.kitty;
in { in {
options.modules.kitty = { enable = mkEnableOption "kitty"; }; options.modules.kitty = { enable = mkEnableOption "kitty"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [ kitty ];
kitty
];
home.file.".config/kitty/kitty.conf".source = ./kitty.conf; home.file.".config/kitty/kitty.conf".source = ./kitty.conf;
}; };
} }

View File

@ -1,9 +1,4 @@
{ { config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vulkan-loader vulkan-loader

View File

@ -4,7 +4,7 @@
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Remove unecessary preinstalled packages # Remove unecessary preinstalled packages
environment.defaultPackages = [ ]; environment.defaultPackages = [ ];
environment.sessionVariables = { GTK_USE_PORTAL = "1"; }; environment.sessionVariables = { GTK_USE_PORTAL = "1"; };
@ -17,7 +17,7 @@
environment.etc.openvpn.source = "${pkgs.update-resolv-conf}/libexec/openvpn"; environment.etc.openvpn.source = "${pkgs.update-resolv-conf}/libexec/openvpn";
# Laptop-specific packages (the other ones are installed in `packages.nix`) # Laptop-specific packages (the other ones are installed in `packages.nix`)
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
acpi acpi
tlp tlp
@ -32,14 +32,15 @@
enable = true; enable = true;
settings = { settings = {
default_session = { default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting 'Welcome to NixOS!' --cmd Hyprland"; command =
"${pkgs.greetd.tuigreet}/bin/tuigreet --time --greeting 'Welcome to NixOS!' --cmd Hyprland";
user = "${user}"; user = "${user}";
}; };
}; };
}; };
services.openssh.enable = true; services.openssh.enable = true;
systemd.services.sshd.wantedBy = lib.mkForce []; systemd.services.sshd.wantedBy = lib.mkForce [ ];
programs.ssh.startAgent = true; programs.ssh.startAgent = true;
@ -58,17 +59,14 @@
roboto roboto
openmoji-color openmoji-color
(nerdfonts.override { fonts = [ "FiraCode" ]; }) (nerdfonts.override { fonts = [ "FiraCode" ]; })
(nerdfonts.override { fonts = [ "FantasqueSansMono" ];}) (nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
]; ];
fontconfig = { fontconfig = {
hinting.autohint = true; hinting.autohint = true;
defaultFonts = { defaultFonts = { emoji = [ "OpenMoji Color" ]; };
emoji = [ "OpenMoji Color" ];
}; };
}; };
};
xdg = { xdg = {
icons.enable = true; icons.enable = true;
@ -83,7 +81,6 @@
xdg.portal.config.common.default = "*"; xdg.portal.config.common.default = "*";
programs.dconf.enable = true; programs.dconf.enable = true;
services.dbus.packages = with pkgs; [ dconf ]; services.dbus.packages = with pkgs; [ dconf ];
services.dbus.enable = true; services.dbus.enable = true;
@ -93,10 +90,10 @@
package = lib.mkForce pkgs.gnome3.gvfs; package = lib.mkForce pkgs.gnome3.gvfs;
}; };
# Firmware Updater # Firmware Updater
services.fwupd.enable = true; services.fwupd.enable = true;
# Nix settings, auto cleanup and enable flakes # Nix settings, auto cleanup and enable flakes
nix = { nix = {
settings.auto-optimise-store = true; settings.auto-optimise-store = true;
settings.allowed-users = [ "${user}" ]; settings.allowed-users = [ "${user}" ];
@ -112,7 +109,7 @@
''; '';
}; };
# Boot settings: clean /tmp/, latest kernel and enable bootloader # Boot settings: clean /tmp/, latest kernel and enable bootloader
boot = { boot = {
tmp.cleanOnBoot = true; tmp.cleanOnBoot = true;
loader = { loader = {
@ -123,7 +120,7 @@
}; };
}; };
# Set up locales (timezone and keyboard layout) # Set up locales (timezone and keyboard layout)
time.timeZone = "Europe/Ljubljana"; time.timeZone = "Europe/Ljubljana";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
console = { console = {
@ -131,25 +128,25 @@
keyMap = "en"; keyMap = "en";
}; };
# Set up user and enable sudo # Set up user and enable sudo
users.users.${user} = { users.users.${user} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "input" "wheel" "networkmanager" "libvirtd" "wireshark" ]; extraGroups = [ "input" "wheel" "networkmanager" "libvirtd" "wireshark" ];
initialHashedPassword = "$6$wqCHereET3WM6UIA$XeJIgGkmO2/zAkktN2JCx5hLNS3kSj6seVQBdSWoMeJ5MOrIha6B/HiDjHI4oKDKYhYVwjgQFqGpncU6OI7Ud/"; # password: d3fault initialHashedPassword =
"$6$wqCHereET3WM6UIA$XeJIgGkmO2/zAkktN2JCx5hLNS3kSj6seVQBdSWoMeJ5MOrIha6B/HiDjHI4oKDKYhYVwjgQFqGpncU6OI7Ud/"; # password: d3fault
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
# Set up networking and secure it # Set up networking and secure it
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
hostName = "${hostName}"; hostName = "${hostName}";
firewall.enable = false; # This one is necessary to expose ports to the netwok. Usefull for smbserver, responder, http.server, ... firewall.enable =
extraHosts = false; # This one is necessary to expose ports to the netwok. Usefull for smbserver, responder, http.server, ...
'' extraHosts = ""; # For adding hosts.
''; # For adding hosts.
}; };
# Set environment variables # Set environment variables
environment.variables = { environment.variables = {
NIXOS_CONFIG_DIR = "$HOME/.config/nixos/"; NIXOS_CONFIG_DIR = "$HOME/.config/nixos/";
NIXPKGS_ALLOW_INSECURE = "1"; NIXPKGS_ALLOW_INSECURE = "1";
@ -167,15 +164,16 @@
}; };
environment.localBinInPath = true; environment.localBinInPath = true;
# Security # Security
security = { security = {
sudo.enable = true; sudo.enable = true;
# Extra security # Extra security
protectKernelImage = true; protectKernelImage = true;
pam.services.gtklock.text = lib.readFile "${pkgs.gtklock}/etc/pam.d/gtklock"; pam.services.gtklock.text =
lib.readFile "${pkgs.gtklock}/etc/pam.d/gtklock";
}; };
# Sound (PipeWire) # Sound (PipeWire)
sound.enable = true; sound.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
@ -194,7 +192,8 @@
}; };
}; };
virtualisation.waydroid.enable = true; # For mobile app pentesting TODO: Move to module. virtualisation.waydroid.enable =
true; # For mobile app pentesting TODO: Move to module.
programs.adb.enable = true; programs.adb.enable = true;
services.blueman.enable = true; services.blueman.enable = true;

View File

@ -6,13 +6,7 @@ let cfg = config.modules.zsh;
in { in {
options.modules.zsh = { enable = mkEnableOption "zsh"; }; options.modules.zsh = { enable = mkEnableOption "zsh"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [ zsh fzf lsd grc eza ];
zsh
fzf
lsd
grc
eza
];
programs.zsh = { programs.zsh = {
enable = true; enable = true;