diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2377d20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +example/*/flake.lock +example/*/hardware-configuration.nix diff --git a/Configurations/Hosts/Default/configuration.nix b/Configurations/Hosts/Default/configuration.nix deleted file mode 100644 index 8df8f3e..0000000 --- a/Configurations/Hosts/Default/configuration.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ config, pkgs, host, lib, inputs, userconf, ... }: - -let - # Load user-specific variables - userVars = import ./variables/user-vars.nix; - inherit (userVars) username gitUsername gitEmail keyboardLayout; - nixDirectory = "/home/${username}/NixOS"; -in { - ################################################################ - # Module Imports - ################################################################ - - imports = [ - # Host-specific hardware configuration (autogenerated) - ./hardware-configuration.nix - - # System-level user definition - ./user.nix - - # Base and global modules - ../../../Modules/System - - # Home Manager integration - inputs.home-manager.nixosModules.home-manager - - ]; - ################################################################ - # Display & Desktop Environment - ################################################################ - - services.xserver = { - enable = true; - desktopManager.xfce.enable = true; - xkb = { - layout = "de"; - variant = ""; - }; - }; - - services.xserver.displayManager.lightdm.enable = false; - - services.displayManager.sddm = { - enable = true; - package = pkgs.qt6Packages.sddm; - }; - - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - - ################################################################ - # System Packages (XFCE & Utilities) - ################################################################ - - environment.systemPackages = with pkgs; [ - xdg-desktop-portal-gtk - - # XFCE Core - xfce.xfwm4 - xfce.xfce4-panel - xfce.xfce4-session - xfce.xfce4-settings - xfce.thunar - xfce.mousepad - xfce.xfce4-terminal - xfce.xfce4-appfinder - xfce.xfce4-power-manager - xfce.xfce4-notifyd - xfce.xfce4-whiskermenu-plugin - - # Optional Extras - xfce.gigolo - xfce.xfce4-screenshooter - xfce.parole - # xfce.xfce4-clipman - - # other: - zsh - - - ]; - - - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers - }; - - services.openssh.enable = true; - - programs.zsh = { - enable = true; - ohMyZsh = { - enable = true; - theme = "xiong-chiamiov-plus"; - plugins = ["git"]; - }; - }; - - - - - - ################################################################ - # Home Manager Configuration - ################################################################ - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "delme-HMbackup"; - - users.${username} = import ./home/home.nix { - inherit config nixDirectory pkgs; - }; - }; - - ################################################################ - # Bootloader - ################################################################ - - boot.loader = { - grub = { - enable = true; - efiSupport = false; - useOSProber = false; - devices = ["nodev"]; - }; - systemd-boot.enable = false; - efi.canTouchEfiVariables = false; - }; - - ################################################################ - # System Version - ################################################################ - - system.stateVersion = "25.05"; -} \ No newline at end of file diff --git a/Configurations/Hosts/Default/hardware-configuration.nix b/Configurations/Hosts/Default/hardware-configuration.nix deleted file mode 100644 index 7a96c96..0000000 --- a/Configurations/Hosts/Default/hardware-configuration.nix +++ /dev/null @@ -1,42 +0,0 @@ -# Do not modify this file! It was generated by โ€˜nixos-generate-configโ€™ - -{ config, lib, pkgs, modulesPath, ... }: - -{ - -abort '' - This file is a placeholder and should not be edited manually. - - Please run: - nixos-generate-config - - to regenerate the correct hardware configuration. - - This file was intentionally disabled to prevent accidental editing. -''; - - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; - - boot.initrd.125312 = [ "ah124123ci" "xhci_pci" "ยน3ยน32134" "2143432" "12441234" ]; - boot.initrd.14231 = [ ]; - boot.124 = [ "124-124214" ]; - boot.1241324134 = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/9b55ed5e-1-443f-a5e8-1fb378fdad77"; - fsType = "ext4"; - }; - - swapDevices = [ 1241324134124214]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault 1324414124444444444444444444444444444444444; - # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/Configurations/Hosts/Default/home/desktop.nix b/Configurations/Hosts/Default/home/desktop.nix deleted file mode 100644 index d3c9050..0000000 --- a/Configurations/Hosts/Default/home/desktop.nix +++ /dev/null @@ -1,169 +0,0 @@ -{ config, pkgs, lib, ... }: - -let - # Your application definitions - apps = { - brave = { - name = "Brave"; - genericName = "Web Browser"; - exec = "brave"; - icon = "world"; - comment = "Browse the Web"; - terminal = false; - categories = [ "Network" "WebBrowser" ]; - }; - - terminal = { - name = "Terminal"; - exec = "xfce4-terminal"; - icon = "utilities-terminal"; - comment = "Run a terminal emulator"; - terminal = true; - categories = [ "System" "Utility" ]; - }; - - libre-calc = { - name = "Libre Calc"; - exec = "libreoffice --calc"; - icon = "libreoffice-calc"; - comment = "Spreadsheet program"; - terminal = false; - categories = [ "Office" ]; - }; - - libre-write = { - name = "Libre Write"; - exec = "libreoffice --writer"; - icon = "libreoffice-writer"; - comment = "Word processor"; - terminal = false; - categories = [ "Office" ]; - }; - - mpv = { - name = "MPV"; - exec = "mpv"; - icon = "mpv"; - comment = "Video Player"; - terminal = false; - categories = [ "AudioVideo" "Player" ]; - }; - - obsidian = { - name = "Obsidian"; - exec = "obsidian %u"; - icon = "obsidian"; - comment = "Markdown Editor"; - terminal = false; - categories = [ "Office" "Utility" ]; - }; - - gwenview = { - name = "Gwenview"; - exec = "gwenview %U"; - icon = "gwenview"; - comment = "Image Viewer"; - terminal = false; - categories = [ "Graphics" ]; - }; - - krita = { - name = "Krita"; - exec = "krita %F"; - icon = "krita"; - comment = "Digital painting"; - terminal = false; - categories = [ "Graphics" ]; - }; - - prism-launcher = { - name = "Prism Launcher"; - exec = "prismlauncher %U"; - icon = "minecraft"; - comment = "Minecraft Launcher"; - terminal = false; - categories = [ "Game" ]; - }; - - protonvpn = { - name = "ProtonVPN"; - exec = "protonvpn-app"; - icon = "protonvpn"; - comment = "VPN Client"; - terminal = false; - categories = [ "Network" "Security" ]; - }; - - signal = { - name = "Signal"; - exec = "signal-desktop %U"; - icon = "signal-desktop"; - comment = "Private Messenger"; - terminal = false; - categories = [ "Network" "InstantMessaging" ]; - }; - - vesktop = { - name = "Vesktop"; - exec = "vesktop %U"; - icon = "discord"; - comment = "Discord Client"; - terminal = false; - categories = [ "Network" "Chat" ]; - }; - - spotify = { - name = "Spotify"; - exec = "spotify %U"; - icon = "spotify"; - comment = "Spotify Music"; - terminal = false; - categories = [ "AudioVideo" "Player" ]; - }; - - okular = { - name = "Okular"; - exec = "okular %U"; - icon = "okular"; - comment = "PDF Viewer"; - terminal = false; - categories = [ "Office" "Viewer" ]; - }; - - steam = { - name = "Steam"; - exec = "steam"; - icon = "steam"; - comment = "Steam Game Platform"; - terminal = false; - categories = [ "Game" ]; - }; - }; - -in { - home.activation.desktopFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] ( - '' - mkdir -p "$HOME/Desktop" - '' + (lib.concatStringsSep "\n" (lib.mapAttrsToList (name: data: - let - desktopText = '' - [Desktop Entry] - Version=1.0 - Type=Application - Name=${data.name} - ${lib.optionalString (data ? genericName) "GenericName=${data.genericName}"} - Comment=${data.comment} - Exec=${data.exec} - Icon=${data.icon} - Terminal=${if data.terminal then "true" else "false"} - Categories=${lib.concatStringsSep ";" data.categories}; - ''; - in '' - cat > "$HOME/Desktop/${name}.desktop" < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-panel.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-panel.xml deleted file mode 100644 index 6286790..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-panel.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-sessions.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-sessions.xml deleted file mode 100644 index 6ac9b5b..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-sessions.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfwm4.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xfwm4.xml deleted file mode 100644 index 25adfc6..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfwm4.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xsettings.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xsettings.xml deleted file mode 100644 index c79abe1..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xsettings.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Modules/Desktops/XFCE-retro/default.nix b/Modules/Desktops/XFCE-retro/default.nix deleted file mode 100644 index c561c3a..0000000 --- a/Modules/Desktops/XFCE-retro/default.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - - chicago95 = pkgs.callPackage ../../../Ressources/Themes/Chicago95/chicago95.nix {}; - dotfilesPath = ./Dotfiles; - resourcesPath = ../../../Ressources; - wallpaperFile = "Wallpaper/NixOS-95-wallpaper.png"; - wallpaperPath = "${config.home.homeDirectory}/${wallpaperFile}"; - wallpaperOrigin = "${resourcesPath}/Images/Wallpapers/Wallpaper-1.png"; - dotfiles = "${dotfilesPath}"; -in { - gtk = { - enable = true; - theme = { - name = "Chicago95"; - package = chicago95; - }; - iconTheme = { - name = "Win95_plus"; - package = pkgs.callPackage ../../../Ressources/Themes/Win95_plus/win95_plus.nix {}; - }; - cursorTheme = { - name = "Chicago95"; - package = chicago95; - }; - font = { - name = "Sans"; - size = 12; - }; - }; - - home.pointerCursor = { - name = "Chicago95"; - package = chicago95; - size = 24; - gtk.enable = true; - x11.enable = true; - }; - - home.packages = with pkgs; [ - xfce.xfce4-panel - xfce.xfconf - xfce.xfdesktop - xfce.xfce4-whiskermenu-plugin - xfce.xfce4-docklike-plugin - xorg.xrandr - ]; - - home.file = { - "${wallpaperFile}" = { - source = wallpaperOrigin; - }; - }; - - xdg.configFile = { - "xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml".source = "${dotfiles}/xfce4-desktop.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xfce4-sessions.xml".source = "${dotfiles}/xfce4-sessions.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xsettings.xml".source = "${dotfiles}/xsettings.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml".source = "${dotfiles}/xfwm4.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml".source = "${dotfiles}/xfce4-keyboard-shortcuts.xml"; - - # Panel: - "xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml".source = "${dotfiles}/xfce4-panel.xml"; - "xfce4/panel/launcher-13/brave.desktop".source = "${dotfiles}/launcher-13/brave.desktop"; - "xfce4/panel/launcher-14/signal.desktop".source = "${dotfiles}/launcher-14/signal.desktop"; - "xfce4/panel/launcher-15/obsidian.desktop".source = "${dotfiles}/launcher-15/obsidian.desktop"; - "xfce4/panel/launcher-16/spotify.desktop".source = "${dotfiles}/launcher-16/spotify.desktop"; - - - }; - - home.activation.applyXfceTweaks = lib.hm.dag.entryAfter ["writeBoundary"] '' - ${pkgs.xfce.xfdesktop}/bin/xfdesktop --reload - ''; -} diff --git a/Modules/System/common.nix b/Modules/System/common.nix deleted file mode 100644 index dde1865..0000000 --- a/Modules/System/common.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - config, - pkgs, - lib, - host, - ... -}: { - - # Enable Bluetooth - hardware.bluetooth.enable = true; # enables support for Bluetooth - hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot - - - # Enable firmware (Intel AX200 needs firmware files from linux-firmware) - hardware.enableAllFirmware = true; - hardware.firmware = [ pkgs.linux-firmware ]; - - - #error: The option `dconf' does not exist. Definition values: - programs.dconf.enable = true; - - networking = { - networkmanager.enable = true; - hostName = host; - }; - - time.timeZone = "Europe/Berlin"; - - i18n.defaultLocale = "en_GB.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"; - }; - - nix.settings.experimental-features = ["nix-command" "flakes"]; - nixpkgs.config.allowUnfree = true; - - console.keyMap = "de"; - - services.printing.enable = true; - - # Sound and pipewire - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; -} diff --git a/Modules/System/default.nix b/Modules/System/default.nix deleted file mode 100644 index d6c3251..0000000 --- a/Modules/System/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -# Import all modules so configuration.nix only needs to import this file -{ config, pkgs, lib, inputs, username, ... }: { - imports = [ - ############## - # โš™๏ธ Defaults # - ############## - ./common.nix - - ]; -} diff --git a/README.md b/README.md index cf8f3ad..db7dcfa 100644 --- a/README.md +++ b/README.md @@ -25,26 +25,17 @@ This is a **NixOS configuration** designed to evoke the pixel-perfect charm of * NixOS-95/ โ”œโ”€โ”€ flake.nix โ”œโ”€โ”€ flake.lock -โ”œโ”€โ”€ Configurations/ -โ”‚ โ””โ”€โ”€ Hosts/ -โ”‚ โ””โ”€โ”€ Default/ -โ”‚ โ”œโ”€โ”€ configuration.nix -โ”‚ โ”œโ”€โ”€ hardware-configuration.nix -โ”‚ โ”œโ”€โ”€ user.nix -โ”‚ โ”œโ”€โ”€ home/ -โ”‚ โ”‚ โ”œโ”€โ”€ home.nix -โ”‚ โ”‚ โ”œโ”€โ”€ desktop.nix -โ”‚ โ”‚ โ””โ”€โ”€ user-packages.nix -โ”‚ โ””โ”€โ”€ variables/ -โ”‚ โ”œโ”€โ”€ system-vars.nix -โ”‚ โ””โ”€โ”€ user-vars.nix โ”œโ”€โ”€ Modules/ โ”‚ โ”œโ”€โ”€ Applications/ -โ”‚ โ”œโ”€โ”€ Desktops/ -โ”‚ โ”‚ โ””โ”€โ”€ XFCE-retro/ -โ”‚ โ”‚ โ”œโ”€โ”€ default.nix -โ”‚ โ”‚ โ””โ”€โ”€ Dotfiles/ โ”‚ โ””โ”€โ”€ System/ +โ”œโ”€โ”€ nixos95 +โ”‚ย ย  โ”œโ”€โ”€ dotfiles/ +โ”‚ย ย  โ”œโ”€โ”€ core.nix +โ”‚ย ย  โ”œโ”€โ”€ default.nix +โ”‚ย ย  โ”œโ”€โ”€ desktop.nix +โ”‚ย ย  โ”œโ”€โ”€ keybinds.nix +โ”‚ย ย  โ”œโ”€โ”€ taskbar.nix +โ”‚ย ย  โ””โ”€โ”€ theme.nix โ”œโ”€โ”€ Ressources/ โ”‚ โ”œโ”€โ”€ Icons/ โ”‚ โ”œโ”€โ”€ Images/ @@ -56,45 +47,144 @@ NixOS-95/ --- +## Installation - BETA -### Wallpaper and Aesthetics +> Requirements: + nix.settings.experimental-features = ["nix-command" "flakes" "pipe-operators"]; + Enabled -Wallpapers are located in `./Resources/Images/Wallpapers`. -Some have been lightly edited. Originals were created by [aconfuseddragon](https://aconfuseddragon.itch.io/downloads). +You can initilize a new flake-based configuration with: +``` +# minimal +nix flake init -t github:Peritia-System/NixOS-95/Dev +# with home-manager +nix flake init -t github:Peritia-System/NixOS-95/Dev#home-manager +``` -> I **do not own** any of the icons or wallpapers. -> If you showcase or redistribute them, **please credit the original artists**. +Or follow the manual installation process: ---- +### 1. Add Nixos95 to your flake and import the module -## Installation +```nix +# flake.nix +{ + inputs = { + nixos95.url = "github:Peritia-System/NixOS-95/Dev"; + nixos95.inputs.nixpkgs.follows = "nixpkgs"; + } + outputs = inputs @ { nixos95, ... }: { + nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem { + modules = [ + nixos95.nixosModules.default + ./configuration.nix + ]; + }; + }; +} +``` -> Requires a NixOS install. +If you are using home-manager you should also pin your version for Nixos95: +``` +{ + inputs = { + ... + nixos95.inputs.home-manager.follows = "home-manager"; + }; + ... +} +``` -1. **Clone the repository**: +### 2. Import in Configuration.nix - ```bash - git clone https://github.com/peritia-system/NixOS-95.git NixOS - cd NixOS - ``` +You can configure Nixos95 under the `nixos95` namespace. For a minimal config just set: +``` +{ + nixos95.enable = true; +} +``` -2. **Regenerate hardware configuration**: +> Warning: This will activate the xfce desktop manager, as well as lightdm and ssdm as display manager. +> You might want to disable your other desktop environment to prevent bugs. - ```bash - sudo nixos-generate-config --dir Configurations/Hosts/Default - ``` +If you want to further customize Nixos95 you can use the following config options (given values are the default ones): -3. **Build and switch to the system configuration**: +```nix +{ + nixos95 = { + enable = true; # default is false + user = "USERNAME"; # no default set; specifies the user used by home-manager - ```bash - sudo nixos-rebuild switch --flake .#default - ``` + wallpaper = ./Resources/Images/Wallpapers/Wallpaper-1.png; -4. **Apply user settings with Home Manager**: + taskbar = { + homeIcon = "whisker-menu-button"; + battery-plugin = { + enable = true; + power_bar = { + enabe = true; + critical_at = 10; + warning_at = 20; + color_warning = "rgb(248,228,92)"; + color_critical = "rgb(237,51,59)"; + color_loading = "rgb(119,118,123)"; + color_default = "rgb(143,240,164)"; + }; + }; + }; + applications = [ + { + name = "Files"; + description = "View and manage local files"; + icon = "folder_open"; + exe = "exo-open --launch FileManager"; + } + { + name = "Terminal"; + description = "Run commands"; + icon = "xfce4-terminal"; + pkg = pkgs.xfce4-terminal; + } + { + name = "Browser"; + description = "Access the world wide web"; + icon = "firefox"; + exe = "exo-open --launch WebBrowser"; + } + ]; - ```bash - home-manager switch - ``` + keybinds = { + commands = [ + { key = "r"; exe = "xfce4-appfinder --collapsed"; } + { key = "XF86WWW"; exe = "exo-open --launch WebBrowser"; } + { key = "XF86Mail"; exe = "exo-open --launch MailReder"; } + { key = "Print"; exe = "xfce4-screenshooter"; } + { key="l"; exe="xflock4"; } + ]; + xfwm4 = [ ]; + }; + }; +} +``` + +### 3. **Build and switch to the system configuration**: + +```bash +sudo NIX_CONFIG="experimental-features = nix-command flakes pipe-operators" nixos-rebuild switch --flake .#default +``` + +### Experimental Features + +NixOS-95 relys on multiple experimental nix features. These are: +1. [flakes](https://wiki.nixos.org/wiki/Flakes) +2. [pipe-operators](https://nix.dev/manual/nix/2.26/language/operators#pipe-operators) +They are needed to activate the configuration. + +To enable them in your config set: +```nix +nix.settings.experimental-features = [ + "flakes" "pipe-operators" +]; +``` ### Rebuild Notes diff --git a/Roadmap.md b/Roadmap.md new file mode 100644 index 0000000..9d3a429 --- /dev/null +++ b/Roadmap.md @@ -0,0 +1,19 @@ +# Upcoming + +| Feature / Fix | Description | Done | +| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | +| Fix Background | Currently the Background does not get set automatically | | +| Adjust the readme | encourage people to edit the standard config atleast slightly | | +| Generate nixo95 instead of a configuration.nix | Currently we are generating a configuration.nix. also encourage people to use their original one. Nixos95 is only supposed to have options that are nessecarry for nixos95 | | +| set default Taskbar location | Currently this has to be done via the settings menu | | +| add the volume meter to the Taskbar | Currently it will get overwritten each time | | +| add an Theme only install way | So that optionally you can just install the Theme and everything else will be set via menus (prevent overwriting) | | +| add Thunar Plugins | Rn this has to be manually added | | +| add Option to preinstall standard tools | Some free tools that are to be expected on a desktop (like a compression tool for example) | | +| set Standard Browser to Librewolf instead of Brave | Right now the Default example Browser is Brave | | +| Set Whisker-Favorites via an Option | this gets overwritten by Default and there is no way to set an option for it | +| Expose an Install ISO | you can write custom NixOS install ISO: [Guide](https://nixos.wiki/wiki/Creating_a_NixOS_live_CD) | +| Screenshotting Tool | Add the XFCE Screenshotter and set the Shortcuts similar to Snapshot (Super + Shift + S) - Screenshot Selected region; (Print) - Screenshot Screen | +| Add Clipboard Manager | Add the XFCE Screenshotter and set the Shortcuts similar to Snapshot (Super + Shift + S) - Screenshot Selected region; (Print) - Screenshot Screen | +| Add a tool to access remote Filesystems | add remote filesystems to thunar (possibility to do so) | + diff --git a/example/default/configuration.nix b/example/default/configuration.nix new file mode 100644 index 0000000..710e991 --- /dev/null +++ b/example/default/configuration.nix @@ -0,0 +1,63 @@ +{ pkgs, ... }: { + + system.stateVersion = "25.05"; + nix.settings.experimental-features = [ + "flakes" "nix-command" "pipe-operators" + ]; + + nixos95 = { + enable = true; + user = "alice"; + + taskbar = { + homeIcon = "whisker-menu-button"; + battery-plugin.enable = false; + applications = [ + { + name = "Files"; + description = "View and manage local files"; + icon = "folder_open"; + exe = "exo-open --launch FileManager"; + } + { + name = "Firefox"; + description = "Browse the Web"; + pkg = pkgs.firefox; + icon = "world"; + } + { + name = "Signal"; + description = "Private Messenger"; + pkg = pkgs.signal-desktop; + icon = "signal"; + } + ]; + }; + + keybinds = { + commands = [ + { key="l"; exe="xflock4"; } + ]; + }; + }; + + users.users.alice = { + isNormalUser = true; + initialPassword = "password"; + home = "/home/alice"; + createHome = true; + + packages = [ + pkgs.firefox + pkgs.neovim + pkgs.signal-desktop + ]; + }; + + networking.hostName = "nixos95"; + networking.networkmanager.enable = true; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + +} diff --git a/example/default/flake.nix b/example/default/flake.nix new file mode 100644 index 0000000..6b163c5 --- /dev/null +++ b/example/default/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Nixos95 example configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + nixos95 = { + url = "github:Peritia-System/NixOS-95"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, nixos95, ... }: { + + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + system = "x84_64-linux"; + modules = [ + nixos95.nixosModules.default + ./configuration.nix + ./hardware-configuration.nix + ]; + }; + + }; +} diff --git a/example/home-manager/configuration.nix b/example/home-manager/configuration.nix new file mode 100644 index 0000000..d994db5 --- /dev/null +++ b/example/home-manager/configuration.nix @@ -0,0 +1,66 @@ +{ pkgs, ... }: { + + system.stateVersion = "25.05"; + nix.settings.experimental-features = [ + "flakes" "nix-command" "pipe-operators" + ]; + + nixos95 = { + enable = true; + user = "alice"; + + taskbar = { + homeIcon = "whisker-menu-button"; + battery-plugin.enable = false; + applications = [ + { + name = "Files"; + description = "View and manage local files"; + icon = "folder_open"; + exe = "exo-open --launch FileManager"; + } + { + name = "Firefox"; + description = "Browse the Web"; + pkg = pkgs.firefox; + icon = "world"; + } + { + name = "Signal"; + description = "Private Messenger"; + pkg = pkgs.signal-desktop; + icon = "signal"; + } + ]; + }; + + keybinds = { + commands = [ + { key="l"; exe="xflock4"; } + ]; + }; + }; + + networking.hostName = "nixos95"; + users.users.alice = { + isNormalUser = true; + initialPassword = "password"; + home = "/home/alice"; + createHome = true; + }; + + home-manager.users.alice = { + programs.firefox.enable = true; + programs.neovim.enable = true; + + home.packages = [ + pkgs.signal-desktop + ]; + }; + + networking.networkmanager.enable = true; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + +} diff --git a/example/home-manager/flake.nix b/example/home-manager/flake.nix new file mode 100644 index 0000000..fbd677d --- /dev/null +++ b/example/home-manager/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Nixos95 example configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixos95 = { + url = "github:Peritia-System/NixOS-95"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + }; + + outputs = { nixpkgs, nixos95, home-manager, ... }: { + + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + system = "x84_64-linux"; + modules = [ + nixos95.nixosModules.default + home-manager.nixosModules.home-manager + + ./configuration.nix + ./hardware-configuration.nix + ]; + }; + + }; +} diff --git a/flake.lock b/flake.lock index 039c8c6..2a00108 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1753294394, - "narHash": "sha256-1Dfgq09lHZ8AdYB2Deu/mYP1pMNpob8CgqT5Mzo44eI=", + "lastModified": 1768271922, + "narHash": "sha256-zmFw7AtcmfMxW3vR7AiGeQQeHhdrd2x7a3hxzd6vJYI=", "owner": "nix-community", "repo": "home-manager", - "rev": "1fde6fb1be6cd5dc513dc1c287d69e4eb2de973e", + "rev": "fbd566923adcfa67be512a14a79467e2ab8a5777", "type": "github" }, "original": { @@ -22,15 +22,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1753250450, - "narHash": "sha256-i+CQV2rPmP8wHxj0aq4siYyohHwVlsh40kV89f3nw1s=", - "owner": "nixos", + "lastModified": 1768127708, + "narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "fc02ee70efb805d3b2865908a13ddd4474557ecf", + "rev": "ffbc9f8cbaacfb331b6017d5a5abb21a492c9a38", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" diff --git a/flake.nix b/flake.nix index 8e08c98..03f28ba 100644 --- a/flake.nix +++ b/flake.nix @@ -1,43 +1,40 @@ { - description = "NixOS-95"; + description = "NixOS-95: To Style your NixOS to look like Windows95"; - ################################################################ - # ๐Ÿ”— Inputs - ################################################################ inputs = { - # Core NixOS packages - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - - # Home Manager - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - ################################################################ - # ๐Ÿš€ Outputs - ################################################################ - outputs = inputs @ { - self, - nixpkgs, - home-manager, - ... - }: { - nixosConfigurations = { - ############################################################ - # ๐Ÿ’ป Default Host - ############################################################ - default = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs self; - host = "default"; - }; - modules = [ - ./Configurations/Hosts/Default/configuration.nix - ]; - }; - + outputs = { self, nixpkgs, home-manager,... }: { + nixosModules.default = import ./nixos95 { inherit home-manager; }; + + templates.default = { + description = "Minimal Nixos-95 configuration"; + path = ./example/default; + welcomeText = '' + # Welcome to Nixos95 + + Please run `วนixos-generate-config --dir .` to generate hardware configuration. + + > You can now continue with Step 3 in the README.md + ''; + }; + + templates.home-manager = { + description = "Minimal Nixos-95 configuration with home-manager"; + path = ./example/home-manager; + welcomeText = '' + # Welcome to Nixos95 (with home-manager) + + Please run `nixos-generate-config --dir .` to generate harde configuration. + + > You can now continue with Step 3 in the README.md + ''; }; }; } + diff --git a/nixos95/core.nix b/nixos95/core.nix new file mode 100644 index 0000000..6894bf5 --- /dev/null +++ b/nixos95/core.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: let + cfg = config.nixos95; +in lib.mkIf cfg.enable { + + + home-manager.users.${cfg.user}.home.stateVersion = lib.mkDefault "25.05"; + + services.xserver = { + enable = true; + desktopManager.xfce.enable = true; + xkb = { + layout = "de"; + variant = ""; + }; + }; + services.xserver.displayManager.lightdm.enable = false; + + services.displayManager.sddm = { + enable = true; + package = pkgs.qt6Packages.sddm; + }; + + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + + environment.systemPackages = [ + pkgs.xfce4-screenshooter + ]; + +} diff --git a/nixos95/default.nix b/nixos95/default.nix new file mode 100644 index 0000000..18fae8a --- /dev/null +++ b/nixos95/default.nix @@ -0,0 +1,26 @@ +{ home-manager }: { config, lib, ...}: let + cfg = config.nixos95; +in { + + options.nixos95 = { + enable = lib.mkEnableOption "NixOS-95 Desktop environment"; + user = lib.mkOption { + description = '' + Username of the home-manager user. + ''; + type = lib.types.str; + example = "user"; + }; + }; + + imports = [ + home-manager.nixosModules.home-manager + + ./core.nix + #./desktop.nix + ./keybinds.nix + ./taskbar.nix + ./theme.nix + ]; + +} diff --git a/nixos95/desktop.nix b/nixos95/desktop.nix new file mode 100644 index 0000000..39d1c94 --- /dev/null +++ b/nixos95/desktop.nix @@ -0,0 +1,35 @@ +{ inputs, config, lib, pkgs, ... }: let + cfg = config.nixos95; +in { + + options.nixos95 = { + + wallpaper = lib.mkOption { + description = "The wallpaper to use"; + type = lib.types.path; + default = ../Ressources/Images/Wallpapers/Wallpaper-1.png; + }; + + }; + + config = lib.mkIf cfg.enable { + + home-manager.users.${cfg.user} = { + + xdg.configFile = { + "xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml" = let + sed = lib.getExe pkgs.gnused; + desktop = pkgs.runCommand "desktop.xml" { } '' + ${sed} -e "s|NIXOS-95_WALLPAPER|${cfg.wallpaper}|g" ${./dotfiles/xfce4-desktop.xml} > $out + ''; + in { + force = true; + source = desktop; + }; + }; + + }; + + }; + +} diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-desktop.xml b/nixos95/dotfiles/xfce4-desktop.xml similarity index 85% rename from Modules/Desktops/XFCE-retro/Dotfiles/xfce4-desktop.xml rename to nixos95/dotfiles/xfce4-desktop.xml index 8c8d4cb..f74c768 100644 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-desktop.xml +++ b/nixos95/dotfiles/xfce4-desktop.xml @@ -5,13 +5,13 @@ - + - + diff --git a/nixos95/dotfiles/xfwm4-keybinds.xml b/nixos95/dotfiles/xfwm4-keybinds.xml new file mode 100644 index 0000000..cbf5bf8 --- /dev/null +++ b/nixos95/dotfiles/xfwm4-keybinds.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nixos95/keybinds.nix b/nixos95/keybinds.nix new file mode 100644 index 0000000..e79d8aa --- /dev/null +++ b/nixos95/keybinds.nix @@ -0,0 +1,148 @@ +/** +* For now this just hard copies the config file. +* This can be improved by allowing users to define there own keybinds +*/ +{ config, lib, pkgs, ... }: let + cfg = config.nixos95.keybinds; + t = lib.types; + slib = pkgs.callPackage ./util/lib.nix { }; +in { + + options.nixos95.keybinds = { + default_commands = lib.mkOption { + internal = true; + description = '' + INTERNAL: additional default keyboard shortcuts to add + ''; + type = t.listOf t.attrs; + default = let + # relies on pulseaudio + pactl = lib.getExe' pkgs.pulseaudio "pactl"; + in [ + { + key = "XF86WWW"; + exe = "exo-open --launch WebBrowser"; + } + { + key = "XF86Mail"; + exe = "exo-open --launch MailReder"; + } + { + key = "Print"; + exe = "xfce4-screenshooter"; + } + { + key = "s"; + exe = "xfce4-screenshooter --fullscreen"; + } + { + key = "Super_L"; + pkg = pkgs.xfce4-whiskermenu-plugin; # open whiskermenu with a press on SUPER like on windows + } + { + key = "XF86AudioMute"; + exe = "${pactl} set-sink-mute @DEFAULT_SINK@ toggle"; + } + { + key = "XF86AudioLowerVolume"; + exe = "${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; + } + { + key = "XF86AudioRaiseVolume"; + exe = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + } + ]; + }; + commands = lib.mkOption { + description = '' + Keyboard shortcuts that should be made available. + + Each keyboard shortcut is defined as a set with the follwoing schema: + { + enable = bool; [optional; default = true] + key = string; [key sequence to triggger the command] + # to specify which command to execute use on of the following: + pkg = package; [use mainProgramm of a nix package; e.g. pkgs.firefox] + exe = string; [provide a program name directly; e.g. firefox] + } + + > Modifier keys must be surrounded by angle brackets + ''; + type = t.listOf t.attrs; + default = [ + { + key = "r"; + exe = "xfce4-appfinder --collapsed"; + } + ]; + }; + xfwm4 = lib.mkOption { + description = '' + Keyboard shortcuts to control xfwm4 + + Each keyboard shortcut is defined as a set with the follwoing schema: + { + enable = bool; [optional; default = true] + key = string; [key sequence to triggger the command] + # to specify which command to execute use on of the following: + pkg = package; [use mainProgramm of a nix package; e.g. pkgs.firefox] + exe = string; [provide a program name directly; e.g. firefox] + } + + > Modifier keys must be surrounded by angle brackets + ''; + type = t.listOf t.attrs; + default = [ ]; + }; + }; + + config = lib.mkIf config.nixos95.enable { + + home-manager.users.${config.nixos95.user} = { + + xdg.configFile = let + to_xml = list : list + |> lib.filter slib.isEnable + |> lib.map ( elm : let + key = lib.escapeXML elm.key; + exe = lib.escapeXML (slib.getExe elm); + in '' '') + |> lib.concatStringsSep "\n"; + default_commands_xml = to_xml cfg.default_commands; + commands_xml = to_xml cfg.commands; + xfwm4_xml = to_xml cfg.xfwm4; + in { + "xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml" = { + force = true; + text = '' + + + + + + + ${default_commands_xml} + ${commands_xml} + + + + + + ${builtins.readFile ./dotfiles/xfwm4-keybinds.xml} + ${xfwm4_xml} + + + + + + + + ''; + }; + }; + + }; + + }; + +} diff --git a/nixos95/taskbar.nix b/nixos95/taskbar.nix new file mode 100644 index 0000000..3540451 --- /dev/null +++ b/nixos95/taskbar.nix @@ -0,0 +1,273 @@ +/** +* For now this just hard copies the config file. +* This can be improved by allowing users to define there own task bar config +*/ +{ config, lib, pkgs, ... }: let + cfg = config.nixos95.taskbar; + user = config.nixos95.user; + t = lib.types; + slib = pkgs.callPackage ./util/lib.nix { }; + +in { + + options.nixos95.taskbar = { + + homeIcon = lib.mkOption { + description = '' + Home icon used in the lefter corner of the taskbar + + Can be either a `path` to an icon to use, + or the name (string) of an icon in the current theme. + This will be the `Win95_plus` theme by default. + You can check for existing icons inside `/Ressources/Icons/Win95_plus`. + ''; + default = "whisker-menu-button"; + type = t.either t.str t.path; + example = "world"; + }; + + battery-plugin = { + enable = lib.mkOption { + description = '' + Enable the battery plugin in the taskbar. + + This will show the charging status in the right corner. + On hover it will show the excat percentage. + ''; + default = true; + example = false; + type = t.bool; + }; + power_bar = let + mkColor = state : default : lib.mkOption { + description = "Color to show while ${state}"; + type = t.str; + inherit default; + }; + in { + enable = lib.mkOption { + description = '' + Enable the power bar, which shows the charging level. + ''; + type = t.bool; + default = true; + example = false; + }; + critical_at = lib.mkOption { + description = '' + Set the maximum battery percentage of the "critical" state + ''; + type = t.int; + default = 10; + example = 20; + }; + warning_at = lib.mkOption { + description = '' + Set the maximum battery percentage of the "warning" state + ''; + type = t.int; + default = 20; + example = 30; + }; + color_warning = mkColor "in a warning state" "rgb(248,228,92)"; + color_critical = mkColor "in a critical state" "rgb(237,51,59)"; + color_loading = mkColor "charging" "rgb(119,118,123)"; + color_default = mkColor "discharging" "rgb(143,240,164)"; + }; + }; + + applications = lib.mkOption { + description = '' + (in order) list of applications to pin in the taskbar. + + Applications must be defined as a set each with the following name-value paris: + { + enable = bool; [optional; default = true] + name = string; [application name shown on hover; optional] + description = string; [text shown on hover; optional] + icon = string | path; [icon shown in the task bar] + terminal = bool; [start the program inside a terminal; optional; default = false] + [either pkg or exe must be defined] + pkg = package; [use mainProgramm of a nix package; e.g. pkgs.firefox] + exe = string; [provide a program name directly; e.g. firefox] + } + + The `icon` can be specified as an icon name (in the current Iocn pack) + or as a `path` to an image directly. + See `/Ressources/Icons/Win95_plus` for the default icons. + + ''; + default = [ + { + name = "Files"; + description = "View and manage local files"; + icon = "folder_open"; + exe = "exo-open --launch FileManager"; + } + { + name = "Terminal"; + description = "Run commands"; + icon = "xfce4-terminal"; + pkg = pkgs.xfce4-terminal; + } + { + name = "Browser"; + description = "Access the world wide web"; + icon = "firefox"; + exe = "exo-open --launch WebBrowser"; + } + ]; + type = t.listOf t.attrs; + }; + + }; + + config = lib.mkIf config.nixos95.enable { + + environment.systemPackages = [ + pkgs.xfce4-whiskermenu-plugin + (lib.mkIf cfg.battery-plugin.enable pkgs.xfce4-battery-plugin) + ]; + + home-manager.users.${user} = { + + xdg.configFile = { + + "xfce4/panel/battery-7.rc" = { + force = true; + enable = cfg.battery-plugin.enable; + text = let + bar = cfg.battery-plugin.power_bar; + in '' + display_label=false + display_icon=true + display_power=false + display_percentage=false + display_bar=${if bar.enable then "true" else "false"} + display_time=false + tooltip_display_percentage=true + tooltip_display_time=false + low_percentage=${builtins.toString bar.warning_at} + critical_percentage=${builtins.toString bar.critical_at} + action_on_low=1 + action_on_critical=1 + hide_when_full=0 + colorA=${bar.color_loading} + colorH=${bar.color_default} + colorL=${bar.color_warning} + colorC=${bar.color_critical} + command_on_low= + command_on_critical= + ''; + }; + + "xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" = let + + ifBattery = str : if cfg.battery-plugin.enable then str else ""; + battery_id = ifBattery '' ''; + battery_xml = ifBattery '' ''; + + applications_cfg = cfg.applications + |> lib.filter slib.isEnable + |> lib.imap0 ( ptr : elm : rec { + # we start IDs in the 20 range to not get confilics with other plugins + plugin_id = "2" + builtins.toString ptr; + plugin_desktop = let + desc = if elm ? description then elm.description else ""; + term = if elm ? terminal && elm.terminal then "true" else "false"; + exec = slib.getExe elm; + in pkgs.writeTextFile { + name = "${elm.name}.desktop"; + text = '' + [Desktop Entry] + Version=1.0 + Type=Application + Name=${elm.name} + Icon=${elm.icon} + Exec=${exec} + Comment=${desc} + Terminal=${term} + ''; + }; + plugin_xml = '' + + + + + + + ''; + }); + + app_ids = applications_cfg + |> lib.map ( elm : '' '' ) + |> lib.concatStringsSep "\n"; + app_xml = applications_cfg + |> lib.map ( elm : elm.plugin_xml ) + |> lib.concatStringsSep "\n"; + + in { + force = true; + text = '' + + + + + + + + + + + + + + + ${app_ids} + + + + + ${battery_id} + + + + + + + + + + + + ${app_xml} + + + + + + + + + + + + + + + + + + + ${battery_xml} + + + ''; + }; + + }; + + }; + }; + +} diff --git a/nixos95/theme.nix b/nixos95/theme.nix new file mode 100644 index 0000000..a8413be --- /dev/null +++ b/nixos95/theme.nix @@ -0,0 +1,35 @@ +{ inputs, config, lib, pkgs, ... }: let + cfg = config.nixos95; + + root = ../.; + baseTheme = { + name = "Chicago95"; + package = pkgs.callPackage "${root}/Ressources/Themes/Chicago95/chicago95.nix" { }; + }; + iconTheme = { + name = "Win95_plus"; + package = pkgs.callPackage "${root}/Ressources/Themes/Win95_plus/win95_plus.nix" { }; + }; +in lib.mkIf cfg.enable { + + home-manager.users.${cfg.user} = { + gtk = { + enable = true; + theme = baseTheme; + iconTheme = iconTheme; + cursorTheme = baseTheme; + font = { + name = "Sans"; + size = 12; + }; + }; + + home.pointerCursor = { + size = 24; + gtk.enable = true; + x11.enable = true; + } // baseTheme; + }; + +} + diff --git a/nixos95/util/lib.nix b/nixos95/util/lib.nix new file mode 100644 index 0000000..b84463e --- /dev/null +++ b/nixos95/util/lib.nix @@ -0,0 +1,6 @@ +{ lib, ... }: { + # return true if elm.enable is not set or elm.enable is true + isEnable = elm : !( lib.hasAttr "enable" elm ) || elm.enable; + # return executable path from elm.pkg if defined or elm.exe + getExe = elm : if elm ? pkg then lib.getExe elm.pkg else elm.exe; +}