diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed825ee --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +Structure: + +|-.nix-config + |-hosts + | + |-home + | + |-willifan + |-default.nix + |-git.nix + |-ssh.nix + |-zsh.nix + | + |-graphical + |-default.nix + |-firefox.nix + |-kitty.nix + |-thunderbird.nix + | + |-dev + | |-default.nix + | |-vscodium.nix + | + |-hyprland + | |-default.nix + | |-hypridle.nix + | |-hyprland.nix + | |-kanshi.nix + | + |-theme + |-default.nix + |-gtk.nix + |-qt.nix \ No newline at end of file diff --git a/flake.nix b/flake.nix index 669e0c0..49b1407 100644 --- a/flake.nix +++ b/flake.nix @@ -35,8 +35,8 @@ modules = [ # Import the previous configuration.nix we used, # so the old configuration file still takes effect - ./configuration.nix + ./hosts/common home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; @@ -47,7 +47,6 @@ # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix } - ]; }; }; diff --git a/hosts/common/applications.nix b/hosts/common/applications.nix new file mode 100644 index 0000000..e74ccaa --- /dev/null +++ b/hosts/common/applications.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + + hyprlock + hypridle + hyprpaper + hyprcursor + grim + slurp + wl-clipboard + kanshi + jq + bc + xorg.xrandr + pulseaudio + inotify-tools + papirus-icon-theme + eww + mako + polkit_gnome + + python3 + usbutils + unzip + + btop + + feh + + kitty + dolphin + hyfetch + wofi + enpass + firefox + thunderbird + webcord + obsidian + kicad + gnome.nautilus + cinnamon.nemo-with-extensions + + + ]; +} \ No newline at end of file diff --git a/hosts/common/auto-cpufreq.nix b/hosts/common/auto-cpufreq.nix new file mode 100644 index 0000000..04bc3c0 --- /dev/null +++ b/hosts/common/auto-cpufreq.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + services.auto-cpufreq = { + enable = true; + settings = { + battery = { + governor = "powersave"; + turbo = "never"; + }; + charger = { + governor = "powersave"; + turbo = "never"; + }; + }; + }; +} \ No newline at end of file diff --git a/hosts/common/boot.nix b/hosts/common/boot.nix new file mode 100644 index 0000000..6cc9777 --- /dev/null +++ b/hosts/common/boot.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: +{ + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + initrd.systemd.enable = true; + plymouth = { + enable = true; + theme = "bgrt"; + logo = "${pkgs.nixos-icons}/share/icons/hicolor/48x48/apps/nix-snowflake-white.png"; + font = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf"; + }; + + consoleLogLevel = 0; + 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" + ]; + # Hide the OS choice for bootloaders. + # It's still possible to open the bootloader list by pressing any key + # It will just not appear on screen unless a key is pressed + loader.timeout = 0; + + }; +} \ No newline at end of file diff --git a/configuration.nix b/hosts/common/configuration.nix similarity index 96% rename from configuration.nix rename to hosts/common/configuration.nix index 717e6c7..dc4765b 100644 --- a/configuration.nix +++ b/hosts/common/configuration.nix @@ -4,6 +4,11 @@ # { config, pkgs, ... }: +#TODO: Bootloader, plymouth, import hardware, hostname, network, locale, unfree, thunderbolt +# auto-cpufreq, fprintd, console keymap, udev, XDG vars, programs, syncthing, rkit/pipewire, nix-ld + +# home: user, electron wayland, polkit + { imports = [ # Include the results of the hardware scan. diff --git a/hosts/common/default.nix b/hosts/common/default.nix new file mode 100644 index 0000000..0131e7b --- /dev/null +++ b/hosts/common/default.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: +{ + networking.hostName = "Lenni"; + imports = [ + ./hardware-configuration.nix + ./applications.nix + ./auto-cpufreq.nix + ./envvar.nix + ./nix-ld-nix + ./pipewire.nix + ./polkit.nix + ./syncthing.nix + ./udev.nix + ./user.nix + ./boot.nix + ./locales.nix + ]; + + networking.networkmanager.enable = true; + console.keyMap = "de"; + nixpkgs.config.allowUnfree = true; + services.hardware.bolt.enable = true; + services.fprintd.enable = true; + programs.hyprland.enable = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + system.stateVersion = "23.11"; +} \ No newline at end of file diff --git a/hosts/common/envvar.nix b/hosts/common/envvar.nix new file mode 100644 index 0000000..4e06ad4 --- /dev/null +++ b/hosts/common/envvar.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: +{ + environment.sessionVariables = rec { + NIXOS_OZONE_WL = "1"; + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_STATE_HOME = "$HOME/.local/state"; + + # Not officially in the specification + #XDG_BIN_HOME = "$HOME/.local/bin"; + #PATH = [ + # "${XDG_BIN_HOME}" + #]; + SCRIPTS = "$XDG_CONFIG_HOME/scripts"; + }; +} \ No newline at end of file diff --git a/hardware-configuration.nix b/hosts/common/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/common/hardware-configuration.nix diff --git a/hosts/common/locales.nix b/hosts/common/locales.nix new file mode 100644 index 0000000..c55b643 --- /dev/null +++ b/hosts/common/locales.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + time.timeZone = "Europe/Berlin"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; +} \ No newline at end of file diff --git a/hosts/common/nix-ld.nix b/hosts/common/nix-ld.nix new file mode 100644 index 0000000..6c4c888 --- /dev/null +++ b/hosts/common/nix-ld.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + programs.nix-ld.enable = true; + + programs.nix-ld.libraries = with pkgs; [ + + # Add any missing dynamic libraries for unpackaged programs + + # here, NOT in environment.systemPackages + + ]; +} \ No newline at end of file diff --git a/hosts/common/pipewire.nix b/hosts/common/pipewire.nix new file mode 100644 index 0000000..5995cd8 --- /dev/null +++ b/hosts/common/pipewire.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + }; +} \ No newline at end of file diff --git a/hosts/common/polkit.nix b/hosts/common/polkit.nix new file mode 100644 index 0000000..a98f45e --- /dev/null +++ b/hosts/common/polkit.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +{ + security.polkit.enable = true; + systemd = { + user.services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + }; +} \ No newline at end of file diff --git a/hosts/common/syncthing.nix b/hosts/common/syncthing.nix new file mode 100644 index 0000000..9789051 --- /dev/null +++ b/hosts/common/syncthing.nix @@ -0,0 +1,47 @@ +{ pkgs, ... }: +{ + services.syncthing = { + enable = true; + user = "willifan"; + dataDir = "/home/willifan/temp"; + configDir = "/home/willifan/temp/.config/syncthing"; + overrideDevices = true; + overrideFolders = true; + settings = { + gui = { + user = "willifan"; + password = "temppassword"; + }; + devices = { + Anton = { id = "SGKTC3I-6IQZ5Z5-VAB76N6-L7DJ3TH-BMSZGKZ-MZPZHLO-KOVMZ2W-V5GQTA6"; }; + }; + folders = { + "Documents" = { + id = "jtl6g-qjmwo"; + path = "/home/willifan/temp/Documents"; + devices = [ "Anton" ]; + }; + "Pictures" = { + id = "po4qj-q9t0t"; + path = "/home/willifan/temp/Pictures"; + devices = [ "Anton" ]; + }; + "Videos" = { + id = "4wqf5-xasng"; + path = "/home/willifan/temp/Videos"; + devices = [ "Anton" ]; + }; + "Notes" = { + id = "oc61n-iewgj"; + path = "/home/willifan/temp/Notes"; + devices = [ "Anton" ]; + }; + "Music" = { + id = "xxh8a-3y2tq"; + path = "/home/willifan/temp/Music"; + devices = [ "Anton" ]; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/hosts/common/udev.nix b/hosts/common/udev.nix new file mode 100644 index 0000000..b922474 --- /dev/null +++ b/hosts/common/udev.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness" + ''; +} \ No newline at end of file diff --git a/hosts/common/user.nix b/hosts/common/user.nix new file mode 100644 index 0000000..c2892f7 --- /dev/null +++ b/hosts/common/user.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + users.users.willifan = { + isNormalUser = true; + description = "willifan"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; +} \ No newline at end of file diff --git a/structure b/structure deleted file mode 100644 index 0562311..0000000 --- a/structure +++ /dev/null @@ -1,14 +0,0 @@ -|-nixos - |-usecase - |-common - |-desktop - | |-common - | | |-willifan - | | |-hyprland - | | |-... - | |-Lenni - | | |-hardware - | |-Pünktchen - | |-hardware - |-server - |-Anton \ No newline at end of file