commit 63d7df756cd19f34130f496724d834d928c4b8d7 Author: chris Date: Sun Feb 22 19:54:17 2026 +0000 Initial commit for nixos diff --git a/nixos/flake.lock b/nixos/flake.lock new file mode 100644 index 0000000..79379a3 --- /dev/null +++ b/nixos/flake.lock @@ -0,0 +1,89 @@ +{ + "nodes": { + "firefox-addons": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1771732978, + "narHash": "sha256-o7gZh/eXFkEEmzwlBdIbgCJhmdlqQhOhVjudqgsIefg=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "18226106e18bc40cce99d436ee741a946f1888f6", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714043624, + "narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1713995372, + "narHash": "sha256-fFE3M0vCoiSwCX02z8VF58jXFRj9enYUSTqjyHAjrds=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "dd37924974b9202f8226ed5d74a252a9785aedf8", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1714076141, + "narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "firefox-addons": "firefox-addons", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nixos/flake.nix b/nixos/flake.nix new file mode 100644 index 0000000..f787598 --- /dev/null +++ b/nixos/flake.nix @@ -0,0 +1,64 @@ +{ + description = "Stationette nix config"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager/release-23.11"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + nixpkgs, + nixpkgs-unstable, + home-manager, + ... + } @ inputs: let + lib = nixpkgs.lib; + # Supported systems for your flake packages, shell, etc. + # "aarch64-linux" + # "i686-linux" + # "x86_64-linux" + # "aarch64-darwin" + # "x86_64-darwin" + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; + in { + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#stationette' + nixosConfigurations = { + stationette = nixpkgs.lib.nixosSystem { + modules = [ + ./system/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.users.chris = import ./home; + home-manager.extraSpecialArgs = { + inherit pkgs-unstable; + inherit inputs; + }; + } + ]; + }; + }; + + # Standalone home-manager configuration entrypoint + homeConfigurations = { + chris = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit pkgs-unstable; + inherit inputs; + }; + modules = [ + ./home + ]; + }; + }; + }; +} diff --git a/nixos/home/config/hypr/bind.conf b/nixos/home/config/hypr/bind.conf new file mode 100644 index 0000000..e5447c7 --- /dev/null +++ b/nixos/home/config/hypr/bind.conf @@ -0,0 +1,56 @@ +$mainMod = SUPER + +bind = $mainMod, Return, exec, kitty +bind = $mainMod, Q, killactive, +bind = $mainMod, M, exec, wlogout --protocol layer-shell +bind = $mainMod, E, exec, thunar +bind = $mainMod, V, togglefloating +bind = $mainMod, D, exec, wofi --show drun +bind = $mainMod, P, pseudo, #dwindle +bind = $mainMod, S, togglesplit, #dwindle +bind = $mainMod SHIFT, Q, exec, swaylock +bind = , PRINT, exec, hyprshot -m region --clipboard-only + +bind = $mainMod, h, movefocus, l +bind = $mainMod, l, movefocus, r +bind = $mainMod, k, movefocus, u +bind = $mainMod, j, movefocus, d + +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +bind = $mainMod CTRL, l, resizeactive, 10 0 +bind = $mainMod CTRL, h, resizeactive, -10 0 +bind = $mainMod CTRL, k, resizeactive, 0 -10 +bind = $mainMod CTRL, j, resizeactive, 0 10 + +bind = $mainMod SHIFT, l, movewindow, r +bind = $mainMod SHIFT, h, movewindow, l +bind = $mainMod SHIFT, k, movewindow, u +bind = $mainMod SHIFT, j, movewindow, d + +bind = $mainMod, b, exec, firefox +bind = $mainMod, c, exec, thunderbird + +# Move/resize windws with mainMod + LMB/RMB and draggin +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow diff --git a/nixos/home/config/hypr/exec.conf b/nixos/home/config/hypr/exec.conf new file mode 100644 index 0000000..f492e72 --- /dev/null +++ b/nixos/home/config/hypr/exec.conf @@ -0,0 +1,11 @@ +exec-once = dbus-update-activation-environment --systemd --all +exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec-once = waybar & hyprpaper +exec-once = swayidle -w +exec-once = nwg-look -a +exec-once = [workspace 2 silent] firefox +exec-once = [workspace 10 silent] telegram-desktop +exec-once = [workspace 10 silent] vesktop +exec-once = [workspace 3 silent] thunderbird +exec-once = [workspace 5 silent] steam diff --git a/nixos/home/config/hypr/hyprland.conf b/nixos/home/config/hypr/hyprland.conf new file mode 100644 index 0000000..b5a2417 --- /dev/null +++ b/nixos/home/config/hypr/hyprland.conf @@ -0,0 +1,6 @@ +source = ~/.config/hypr/monitor.conf +source = ~/.config/hypr/exec.conf +source = ~/.config/hypr/bind.conf +source = ~/.config/hypr/input.conf +source = ~/.config/hypr/window.conf +source = ~/.config/hypr/windowrule.conf diff --git a/nixos/home/config/hypr/hyprpaper.conf b/nixos/home/config/hypr/hyprpaper.conf new file mode 100644 index 0000000..fac88b0 --- /dev/null +++ b/nixos/home/config/hypr/hyprpaper.conf @@ -0,0 +1,4 @@ +#preload = ~/.config/wallpaper/wall.png +#wallpaper = HDMI-A-1, ~/.config/wallpapers/wall.png +splash = false + diff --git a/nixos/home/config/hypr/input.conf b/nixos/home/config/hypr/input.conf new file mode 100644 index 0000000..7933132 --- /dev/null +++ b/nixos/home/config/hypr/input.conf @@ -0,0 +1,16 @@ +input { + kb_layout = gb, us, ro + + kb_variant = + kb_model = + kb_options = grp:alt_shift_toggle, caps:swapescape + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + sensitivity = 0 # -1.0 -1.0, 0 means no modification +} diff --git a/nixos/home/config/hypr/monitor.conf b/nixos/home/config/hypr/monitor.conf new file mode 100644 index 0000000..5fb209c --- /dev/null +++ b/nixos/home/config/hypr/monitor.conf @@ -0,0 +1 @@ +monitor=HDMI-A-1,2560x1440@164.835999, 0x0, 1 diff --git a/nixos/home/config/hypr/window.conf b/nixos/home/config/hypr/window.conf new file mode 100644 index 0000000..ddb3289 --- /dev/null +++ b/nixos/home/config/hypr/window.conf @@ -0,0 +1,55 @@ +general { + gaps_in = 5 + gaps_out = 10 + border_size = 1 + col.active_border = rgb(8aadf4) rgb(24273a) rgb(24273a) rgb(8aadf4) 45deg + col.inactive_border = rgb(24273a) rgb(24273a) rgb(24273a) rgb(24273a) 45deg + layout = dwindle + allow_tearing = false +} + +decoration { + rounding = 10 + blur { + enabled = true + size = 2 + passes = 2 + new_optimizations = true + xray = true + } + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = yes + bezier = overshot, 0.05, 0.9, 0.1, 1.05 + bezier = smoothOut, 0.3, 0, 0.66, -0.56 + bezier = smoothIn, 0.25, 1, 0.5, 1 + animation = windows, 1, 5, overshot, slide + animation = windowsOut, 1, 4, smoothOut, slide + animation = windowsMove, 1, 4, default + animation = border, 1, 10, default + animation = fade, 1, 10, smoothIn + animation = fadeDim, 1, 10, smoothIn + animation = workspaces, 1, 6, default +} + +dwindle { + pseudotile = yes + preserve_split = yes +} + +master { + new_is_master = true +} + +gestures { + workspace_swipe = off +} + +misc { + force_default_wallpaper = 0 +} diff --git a/nixos/home/config/hypr/windowrule.conf b/nixos/home/config/hypr/windowrule.conf new file mode 100644 index 0000000..c19a2db --- /dev/null +++ b/nixos/home/config/hypr/windowrule.conf @@ -0,0 +1,33 @@ +windowrule = float, file_progress +windowrule = float, confirm +windowrule = float, dialog +windowrule = float, download +windowrule = float, notification +windowrule = float, error +windowrule = float, splash +windowrule = float, confirmreset +windowrule = float, title:Open File +windowrule = float, title:branchdialog +windowrule = float, viewnior +windowrule = float, pavucontrol-qt +windowrule = float, pavucontrol +windowrule = float, file-roller +windowrule = fullscreen, wlogout +windowrule = float, title:wlogout +windowrule = fullscreen, title:wlogout +windowrule = idleinhibit stayfocused, mpv +windowrulev2 = float, title:^(Media viewer)$ + +# Picture in picture windows +windowrulev2 = float, title:^(Picture-inPicture)$ +windowrulev2 = pin, title:^(Picture-inPicture)$ +windowrulev2 = float, class:^(vesktop)$,title:^(Discord Popout)$ +windowrulev2 = pin, class:^(vesktop)$,title:^(Discord Popout)$ +windowrulev2 = float, class:^(steam)$,title:^(Friends List)$ + +# Workspace assign +windowrulev2 = workspace: 1, class:^(kitty)$ +windowrulev2 = workspace: 2, class:^(firefox)$ +windowrulev2 = workspace: 5, class:^(steam)$ +windowrulev2 = workspace: 10, class:^(org.telegram.desktop)$ +windowrulev2 = workspace: 10, class:^(vesktop)$ diff --git a/nixos/home/config/swayidle/config b/nixos/home/config/swayidle/config new file mode 100644 index 0000000..fb63ee9 --- /dev/null +++ b/nixos/home/config/swayidle/config @@ -0,0 +1,4 @@ +timeout 300 'swaylock' +timeout 420 'systemctl suspend' +before-sleep 'swaylock' + diff --git a/nixos/home/config/swaylock/config b/nixos/home/config/swaylock/config new file mode 100644 index 0000000..ffacb75 --- /dev/null +++ b/nixos/home/config/swaylock/config @@ -0,0 +1,31 @@ +daemonize +indicator +clock +screenshots + +effect-blur=11x11 +font=JetBrains Mono +indicator-radius=80 +indicator-thickness=8 +timestr=%I:%M %p +datestr=%F + +inside-color=#181926 +ring-color=#8bd5ca +key-hl-color=#cad3f5 +text-color=#cad3f5 +layout-text-color=#cad3f5 +layout-bg-color=#cad3f5 +text-caps-lock-color=#cad3f5 + +inside-clear-color=#f4dbd6 +ring-clear-color=#f0c6c6 +text-clear-color=#1e2030 + +inside-ver-color=#91d7e3 +ring-ver-color=#7dc4e4 +text-ver-color=#1e2030 + +inside-wrong-color=#ee99a0 +ring-wrong-color=#ed8796 +text-wrong-color=#1e2030 diff --git a/nixos/home/config/waybar/config.jsonc b/nixos/home/config/waybar/config.jsonc new file mode 100644 index 0000000..1688a3e --- /dev/null +++ b/nixos/home/config/waybar/config.jsonc @@ -0,0 +1,80 @@ +{ + "layer": "top", + "position": "top", + "mod": "dock", + "exclusice": true, + "passthrough": false, + "gtk-layer-shell": true, + "height": 0, + "modules-left": [ + "hyprland/workspaces" + ], + "modules-center": ["hyprland/window"], + "modules-right": [ + "tray", + "custom/updates", + "hyprland/language", + "pulseaudio", + "pulseaudio#microphone", + "clock", + "custom/weather" + ], + "hyprland/window": { + "format": {} + }, + "hyprland/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "on-click": "activate", + "persisten_workspaces": { + "1": [] + } + }, + "hyprland/language": { + "format": "{}", + "format-en": "EN", + "format-ro": "RO" + }, + "custom/weather": { + "tooltip": true, + "format": "{}", + "interval": 30, + "exec": "~/.config/waybar/scripts/waybar-wttr.py", + "return-type": "json" + }, + "tray": { + "icon-size": 16, + "spacing": 10 + }, + "clock": { + "format": "{:%R %d%M}", + "tooltip-format": "{:%Y %B}\n{calendar}" + }, + "pulseaudio": { + "format": "{icon} {volume}%", + "tooltip": false, + "format-muted": "Muted", + "on-click": "pamixer -t", + "on-scroll-up": "pamixer -i 5", + "on-scroll-down": "pamixer -d 5", + "scroll-step": 5 + // "format-icons": { + // "headphones": "", + // "hands-free": "", + // "headset": "", + // "phone": "", + // "portable": "", + // "car": "", + // "default": ["", "", ""] + // } + }, + "pulseaudio#microphone": { + "format": "{format_source}", + "format-source": "{volume}%", + "format-source-muted": "Muted", + "on-click": "pamixer --default-source -t", + "on-scroll-up": "pamixer --default-source -i 5", + "on-scroll-down": "pamixer --default-source -d 5", + "scroll-step": 5 + } +} diff --git a/nixos/home/config/waybar/scripts/waybar-wttr.py b/nixos/home/config/waybar/scripts/waybar-wttr.py new file mode 100644 index 0000000..b68d17b --- /dev/null +++ b/nixos/home/config/waybar/scripts/waybar-wttr.py @@ -0,0 +1,124 @@ +#!/run/current-system/sw/bin/python + +import json +from datetime import datetime + +import requests + +WEATHER_CODES = { + "113": "Sunny", + "116": "Patchy", + "119": "Cloudy", + "122": "Cloudy", + "143": "Cloudy", + "176": "Rain", + "179": "Rain", + "182": "Rain", + "185": "Rain", + "200": "Storm", + "227": "Rain", + "230": "Rain", + "248": "Cloudy", + "260": "Cloudy", + "263": "Rain", + "266": "Rain", + "281": "Rain", + "284": "Rain", + "293": "Rain", + "296": "Rain", + "299": "Rain", + "302": "Rain", + "305": "Rain", + "308": "Rain", + "311": "Rain", + "314": "Rain", + "317": "Rain", + "320": "Rain", + "323": "Rain", + "326": "Rain", + "329": "Snow", + "332": "Snow", + "335": "Snow", + "338": "Snow", + "350": "Rain", + "353": "Rain", + "356": "Rain", + "359": "Rain", + "362": "Rain", + "365": "Rain", + "368": "Rain", + "371": "Snow", + "374": "Rain", + "377": "Rain", + "386": "Rain", + "389": "Rain", + "392": "Rain", + "395": "Snow", +} + +data = {} + +weather = request.get("https://wttr.in/?format=j1").json() + +def format_time(time): + return time.replace("00", "").zfill(2) + +def format_temp(temp): + return(temp["FeelsLikeC"] + "o").ljust(3) + +def format_chances(hour): + chances = { + "chancesoffog": "Fog", + "chancesoffrost": "Frost", + "chancesofovercast": "Overcast", + "chancesofrain": "Rain", + "chancesofsnow": "Snow", + "chancesofsunshine": "Sunshine", + "chancesofthunder": "Thunder", + "chancesofwindy": "Wind", + } + + conditions = [] + for event in chances.keys(): + if int(hour[event]) > 0: + conditions.append(chances[event] + "" + hour[event] + "%") + return ", ".join(conditions) + +tempint = int(weather["current_condition"][0]["FeelsLikeC"]) +extrachar = "" +if tempint > 0 and tempint < 10: + extrachar = "+" + +data["text"] = ( + " " + + WEATHER_CODES[weather["current_condition"][0]["weatherCode"]] + + " " + + extrachar + + weather["current_condition"][0]["FeelsLikeC"] + + "o" +) + +data["tooltip"] = ( + f"{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}o\n" +) +data["tooltip"] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}o\n" +data["tooltip"] += f"Wind: {weather['current_condition'][0]['WindspeedKmph']}Km/h\n" +data["tooltip"] += f"Humidity: {weather['current_condition'][0]['FeelsLikeC']}%\n" +for i, day in enumerate(weather["weather"]): + data["tooltip"] += f"\n" + if i == 0: + data["tooltip"] += "Today, " + if i == 1: + data["tooltip"] += "Tomorrow, " + data["tooltip"] += f"{day['date']}\n" + data["tooltip"] += f"Up {day['maxtempC']}o Down {day['mintempC']}o " + data["tooltip"] += f"Sunrise {day['astronomy'][0]['sunrise']} Sunset {day['astronomy'][0]['sunset']} \n" + + for hour in day["hourly"]: + if i == 0" + if int(format_time(hour["time"])) < datetime.now().hour - 2: + continue + + data["tooltip"] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n" + +print(json.dumps(data)) diff --git a/nixos/home/config/waybar/style.css b/nixos/home/config/waybar/style.css new file mode 100644 index 0000000..173840c --- /dev/null +++ b/nixos/home/config/waybar/style.css @@ -0,0 +1,149 @@ +* { + border: none; + border-radius: 0; + font-family: + JetBrains Mono Nerd Font, + monospace; + font-weight: bold; + font-size: 14px; + min-height: 0; +} + +window#waybar { + background: rgba(21, 18, 27, 0); + color: #cdd6f4; +} + +tooltip { + background: #1e1e2e; + border-radius: 10px; + border-width: 2px; + border-style: solid; + border-color: #11111b; +} + +#workspaces button { + padding: 5px; + color: #313244; + margin-right: 5px; +} + +#workspaces button.active { + color: #a6adc8; +} + +#workspaces button.focused { + color: #a6adc8; + background: #eba0ac; + border-radius: 10px; +} + +#workspaces button.urgent { + color: #11111b; + background: #a6e3a1; + border-radius: 10px; +} + +#workspaces button.active { + color: #11111b; + background: #cdd6f4; + border-radius: 10px; +} + +#language, +#custom-updates, +#custom-caffeine, +#custom-weather, +#window, +#clock, +#battery, +#pulseaudio, +#network, +#workspaces, +#tray, +#backlight { + background: #1e1e2e; + padding: 0px 10px; + margin: 3px 0px; + margin-top: 10px; + border: 1px solid #181825; +} + +#tray { + border-radius: 10px; + margin-right: 10px; +} + +#workspaces { + background: #1e1e2e; + border-radius: 10px; + margin-left: 10px; + padding-right: 0px; + padding-left: 5px; +} + +#custom-caffeine { + color: #89dceb; + border-radius: 10px 0 0 10px; + border-right: 0; + margin-left: 10px; +} + +#custom-language { + color: #f38ba8; + border-right: 0; + border-left: 0; +} + +#custom-updates { + color: #f5c2e7; + border-radius: 10px 0 0 10px; + border-left: 0; + border-right: 0; +} + +#window { + border-radius: 10px; + margin-left: 0; + margin-right: 0; +} + +#clock { + color: #fab387; + border-radius: 10px 0 0 10px; + margin-left: 5px; + border-right: 0px; +} + +#network { + color: #f9e2af; + border-left: 0px; + border-right: 0px; +} + +#pulseaudio { + color: #89b4fa; + border-left: 0px; + border-right: 0px; +} + +#pulseaudio.microphone { + color: #cba6f7; + border-radius: 0 10px 10px 0; + border-left: 0; + border-right: 0; + margin-right: 5px; +} + +#battery { + color: #a6e3a1; + border-radius: 0 10px 10px 0; + margin-right: 10px; + border-left: 0px; +} + +#custom-weather { + border-radius: 0 10px 10px 0; + border-right: 0; + margin-left: 0; +} diff --git a/nixos/home/config/wlogout/layout b/nixos/home/config/wlogout/layout new file mode 100644 index 0000000..09c5774 --- /dev/null +++ b/nixos/home/config/wlogout/layout @@ -0,0 +1,36 @@ +{ + "label" : "lock", + "action" : "swaylock", + "text" : "Lock", + "keybind" : "l", +} +{ + "label" : "hibernate", + "action" : "systemctl hibernate", + "text" : "Hibernate", + "keybind" : "h", +} +{ + "label" : "logout", + "action" : "sleep 1; hyprctl dispatch exit", + "text" : "Logout", + "keybind" : "e", +} +{ + "label" : "shutdown", + "action" : "systemctl poweroff", + "text" : "Shutdown", + "keybind" : "s", +} +{ + "label" : "suspend", + "action" : "systemctl suspend", + "text" : "Suspend", + "keybind" : "u", +} +{ + "label" : "reboot", + "action" : "systemctl reboot", + "text" : "Reboot", + "keybind" : "r", +} diff --git a/nixos/home/config/wlogout/style.css b/nixos/home/config/wlogout/style.css new file mode 100644 index 0000000..8f377f6 --- /dev/null +++ b/nixos/home/config/wlogout/style.css @@ -0,0 +1,51 @@ +* { + background-image: none; +} + +window { + background-color: rgba(36,39,58,0.9) +} + +button { + margin: 8px; + color: #cad3f5; + background-color: #363a4f; + border-style: solid; + border-width: 2px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; +} + +button:active, +button:focus, +button:hover { + color: #8bd5ca; + background-color: #24273a; + outline-style: none; +} + +#lock{ + /* background-image: image(url("icons/lock.png")); */ +} + +#logout{ + /* background-image: image(url("icons/logout.png")); */ +} + +#suspend{ + /* background-image: image(url("icons/suspend.png")); */ +} + +#hibernate{ + /* background-image: image(url("icons/hibernate.png")); */ +} + +#shutdown{ + /* background-image: image(url("icons/shutdown.png")); */ +} + +#reboot{ + /* background-image: image(url("icons/reboot.png")); */ +} + diff --git a/nixos/home/config/wofi/style.css b/nixos/home/config/wofi/style.css new file mode 100644 index 0000000..111c727 --- /dev/null +++ b/nixos/home/config/wofi/style.css @@ -0,0 +1,74 @@ +@define-color lavender #b7bdf8; +@define-color base #24273a; +@define-color red #ed8796; +@define-color mauve #c6a0f6; + +* { + font-family: "Inconsolata Nerd Font", monospace; + font-size: 14px; +} + +window { + margin: 0; + padding: 10px; + border: 0.16em solid @lavender; + border-radius: 0.1em; + background-color: @base; +} + +#inner-box { + margin: 5px; + padding: 10px; + border: none; + background-color: @base; +} + +#outer-box { + margin: 5px; + padding: 10px; + border: none; + background-color: @base; +} + +#scroll { + margin: o; + padding: 10px; + border none; + background-color: @base; +} + +#input image { + border: none; + color: @red; +} + +#input * { + outline: 4px solid @red !important; +} + +#text { + margin: 5px; + border: none; + color: @text; +} + +#entry { + background-color: @base; +} + +#entry array { + border: none; + color: @lavender; +} + +#entry:selected { + border: 0.11em solid @lavender; +} + +#entry:selected #text { + color: @mauve; +} + +#entry:drop(active) { + background-color: @lavender !important; +} diff --git a/nixos/home/default.nix b/nixos/home/default.nix new file mode 100644 index 0000000..8f1c185 --- /dev/null +++ b/nixos/home/default.nix @@ -0,0 +1,21 @@ +{ + inputs, + lib, + config, + pkgs, + pkgs-unstable, + ... +}: { + imports = [ + ./user + ]; + + home = { + username = "chris"; + homeDirectory = "/home/chris"; + + }; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "23.05"; +} diff --git a/nixos/home/user/config.nix b/nixos/home/user/config.nix new file mode 100644 index 0000000..ac4325f --- /dev/null +++ b/nixos/home/user/config.nix @@ -0,0 +1,12 @@ +let configDir = ../config; +in +{ + home.file = { + ".config/hypr".source = "${configDir}/hypr"; + ".config/swayidle".source = "${configDir}/swayidle"; + ".config/swaylock".source = "${configDir}/swaylock"; + ".config/wlogout".source = "${configDir}/wlogout"; + ".config/waybar".source = "${configDir}/waybar"; + ".config/wofi".source = "${configDir}/wofi"; + }; +} diff --git a/nixos/home/user/default.nix b/nixos/home/user/default.nix new file mode 100644 index 0000000..60d8e1b --- /dev/null +++ b/nixos/home/user/default.nix @@ -0,0 +1,22 @@ +{ + imports = [ + ./git.nix + ./gtk.nix + ./shell.nix + ./config.nix + ./packages.nix + ./programs.nix + ./environment.nix + ]; + + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + + permittedInsecurePackages = [ + "electron-25.9.0" # Obsidian + ]; + }; + }; +} diff --git a/nixos/home/user/environment.nix b/nixos/home/user/environment.nix new file mode 100644 index 0000000..c1f61e8 --- /dev/null +++ b/nixos/home/user/environment.nix @@ -0,0 +1,31 @@ +{ + home.sessionVariables = { + BROWSER = "firefox"; + EDITOR = "nvim"; + TERMINAL = "kitty"; + NIXOS_OZONE_WL = "1"; + QT_QPA_PLATFORMTHEME = "gtk3"; + QT_SCALE_FACTOR = "1"; + MOZ_ENABLE_WAYLAND = "1"; + SDL_VIDEODRIVER = "wayland"; + QT_QPA_PLATFORM = "wayland-egl"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + GTK_CSD = "0"; + WLR_DRM_DEVICES = "/dev/dri/card0"; + WLR_NO_HARDWARE_CURSORS = "1"; + CLUTTER_BACKEND = "wayland"; + WLR_RENDERER = "vulkan"; + XCURSOR_SIZE = "32"; + GTK_THEME = "Catppuccin-Macchiato-Compact-Blue-Dark"; + XDG_CURRENT_DESKTOP = "hyprland"; + XDG_SESSION_DESKTOP = "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + GTK_USE_PORTAL = "1"; + NIXOS_XDG_OPEN_USE_PORTAL = "1"; + XDG_CACHE_HOME = "\${HOME}/.cache"; + XDG_CONFIG_HOME = "\${HOME}/.config"; + #XDG_BIN_HOME = "\${HOME}/.local/bin"; + XDG_DATA_HOME = "\${HOME}/.local/share"; + }; +} diff --git a/nixos/home/user/git.nix b/nixos/home/user/git.nix new file mode 100644 index 0000000..8bc39e1 --- /dev/null +++ b/nixos/home/user/git.nix @@ -0,0 +1,11 @@ +let + userName = "chris"; + email = "stofflees@gmail.com"; +in +{ + programs.git = { + enable = true; + userName = userName; + userEmail = email; + }; +} diff --git a/nixos/home/user/gtk.nix b/nixos/home/user/gtk.nix new file mode 100644 index 0000000..22b80f2 --- /dev/null +++ b/nixos/home/user/gtk.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: + +{ + gtk = { + enable = true; + + cursorTheme = { + name = "Catppuccin-Macchiato-Blue"; + package = pkgs.catppuccin-cursors.macchiatoBlue; + }; + + theme = { + name = "Catppuccin-Macchiato-Compact-Blue-dark"; + package = pkgs.catppuccin-gtk.override { + size = "compact"; + accents = ["blue"]; + variant = "macchiato"; + }; + }; + + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-folders; + }; + + gtk3.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme = 1; + ''; + }; + + gtk4.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme = 1; + ''; + }; + }; +} diff --git a/nixos/home/user/packages.nix b/nixos/home/user/packages.nix new file mode 100644 index 0000000..a5ebfa9 --- /dev/null +++ b/nixos/home/user/packages.nix @@ -0,0 +1,37 @@ +{ pkgs, pkgs-unstable, ... }: + +{ + home.packages = [ + pkgs.jetbrains.rider + pkgs.go + pkgs.lua + # pkgs.nodejs_22 + pkgs.nodePackages.pnpm + (pkgs.python3.withPackages (python-pkgs: [ + python-pkgs.pip + python-pkgs.requests + ])) + pkgs.rustup + pkgs.zig + pkgs.obsidian + pkgs.thunderbird + pkgs.libreoffice-qt + pkgs.hunspell + pkgs.blueberry + pkgs.telegram-desktop + pkgs.steam + pkgs.steam-run + pkgs.yuzu-mainline + (pkgs.lutris.override { + extraPkgs = pkgs: [ + pkgs.wineWowPackages.stable + pkgs.winetricks + ]; + }) + pkgs.viewnior + pkgs-unstable.hyprshot + pkgs.catppuccin-cursors.macchiatoBlue + pkgs.catppuccin-gtk + pkgs.papirus-folders + ]; +} diff --git a/nixos/home/user/programs.nix b/nixos/home/user/programs.nix new file mode 100644 index 0000000..e6c3daf --- /dev/null +++ b/nixos/home/user/programs.nix @@ -0,0 +1,17 @@ +{ inputs, ... }: + +{ + programs.firefox = { + enable = true; + + profiles.chris = { + extensions = with inputs.firefox-addons.packages."x86_64-linux"; [ + darkreader + i-dont-care-about-cookies + ublock-origin + ]; + }; + }; + + programs.home-manager.enable = true; +} diff --git a/nixos/home/user/shell.nix b/nixos/home/user/shell.nix new file mode 100644 index 0000000..2ca73df --- /dev/null +++ b/nixos/home/user/shell.nix @@ -0,0 +1,32 @@ +{ config, pkgs, ... }: + +let + myAliases = { + docker-compose = "podman-compose"; + cat = "bat"; + ls = "eza --icons=always"; + fullClean = '' + nix-collect-garbage --delete-old + + sudo nix-collect-garbage -d + + sudo /run/current-system/bin/switch-to-configuration boot + ''; + rebuild = "sudo nixos-rebuild switch --flake ~/.dotfiles/"; + fullRebuild = "sudo nixos-rebuild switch --flake ~/.dotfiles/ && home-manager switch --flake ~/dotfiles/ -b backup"; + homeRebuild = "home-manager switch --flake ~/.dotfiles/ -b backup"; + }; + in + { + programs = { + zsh = { + enable = true; + enableAutosuggestions = true; + syntaxHighlighting.enable = true; + # initExtra = '' + # eval "${zoxide init --cmd cd zsh)" && + # ''; + shellAliases = myAliases; + }; + }; + } diff --git a/nixos/system/configuration.nix b/nixos/system/configuration.nix new file mode 100644 index 0000000..c53513d --- /dev/null +++ b/nixos/system/configuration.nix @@ -0,0 +1,15 @@ +{ + inputs, + lib, + config, + pkgs, + ... +}: { + imports = [ + ./hardware-configuration.nix + ./modules + ]; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.05"; +} diff --git a/nixos/system/hardware-configuration.nix b/nixos/system/hardware-configuration.nix new file mode 100644 index 0000000..10bcb54 --- /dev/null +++ b/nixos/system/hardware-configuration.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c425db8f-455a-4fec-8a24-72cd670640cb"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/038B-4974"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/system/modules/boot.nix b/nixos/system/modules/boot.nix new file mode 100644 index 0000000..d9ea2ac --- /dev/null +++ b/nixos/system/modules/boot.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: + +{ + boot = { + kernelParams = ["nohibernate" "ipv6.disable=1"]; + tmp.cleanOnBoot = true; + # supportedFilesystems = ["ntfs"]; + loader = { + grub = { + device = "nodev"; + efiSupport = true; + enable = true; + useOSProber = true; + timeoutStyle = "menu"; + efiInstallAsRemovable = true; + extraConfig = '' + insmod tpm + ''; + }; + timeout = 300; + }; + }; +} diff --git a/nixos/system/modules/default.nix b/nixos/system/modules/default.nix new file mode 100644 index 0000000..66ed896 --- /dev/null +++ b/nixos/system/modules/default.nix @@ -0,0 +1,24 @@ +{ ... }: + +{ + imports = [ + ./boot.nix + ./fonts.nix + ./gaming.nix + ./hardware.nix + ./hyprland.nix + ./internationalisation.nix + ./networking.nix + ./nixsettings.nix + ./packages.nix + ./polkit.nix + ./programs.nix + ./security.nix + ./services.nix + ./sound.nix + ./theme.nix + ./time.nix + ./users.nix + ./virtualisation.nix + ]; +} diff --git a/nixos/system/modules/fonts.nix b/nixos/system/modules/fonts.nix new file mode 100644 index 0000000..00310ee --- /dev/null +++ b/nixos/system/modules/fonts.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + fonts.packages = with pkgs; [ + font-awesome + jetbrains-mono + + (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + ]; +} diff --git a/nixos/system/modules/gaming.nix b/nixos/system/modules/gaming.nix new file mode 100644 index 0000000..ac9301b --- /dev/null +++ b/nixos/system/modules/gaming.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ + nix = { + settings = { + warn-dirty = false; + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + substituters = ["https://nix-gaming.cachix.org"]; + trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="]; + }; + }; +} diff --git a/nixos/system/modules/hardware.nix b/nixos/system/modules/hardware.nix new file mode 100644 index 0000000..5a69371 --- /dev/null +++ b/nixos/system/modules/hardware.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + hardware = { + bluetooth.enable = true; + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + }; +} diff --git a/nixos/system/modules/hyprland.nix b/nixos/system/modules/hyprland.nix new file mode 100644 index 0000000..6bcc6af --- /dev/null +++ b/nixos/system/modules/hyprland.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + programs.hyprland = { + enable = true; + }; + + environment.systemPackages = with pkgs; [ + hyprpaper + kitty + libnotify + mako + qt5.qtwayland + qt6.qtwayland + swayidle + swaylock-effects + wlogout + wl-clipboard + wofi + waybar + ]; +} diff --git a/nixos/system/modules/internationalisation.nix b/nixos/system/modules/internationalisation.nix new file mode 100644 index 0000000..ee0bfaa --- /dev/null +++ b/nixos/system/modules/internationalisation.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: + +{ + i18n.defaultLocale = "en_GB.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + i18n.supportedLocales = [ + "en_GB.UTF-8/UTF-8" + "en_US.UTF-8/UTF-8" + "ro_RO.UTF-8/UTF-8" + ]; +} diff --git a/nixos/system/modules/networking.nix b/nixos/system/modules/networking.nix new file mode 100644 index 0000000..dca6f03 --- /dev/null +++ b/nixos/system/modules/networking.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + networking = { + hostName = "stationette"; + networkmanager.enable = true; + enableIPv6 = false; + firewall.enable = false; + }; +} diff --git a/nixos/system/modules/nixsettings.nix b/nixos/system/modules/nixsettings.nix new file mode 100644 index 0000000..a9287ec --- /dev/null +++ b/nixos/system/modules/nixsettings.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: + +{ + documentation.nixos.enable = false; + + nixpkgs.config.allowUnfree = true; + + nix = { + settings = { + warn-dirty = false; + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + substituters = ["https://nix-gaming.cachix.org"]; + trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="]; + }; + + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + }; +} diff --git a/nixos/system/modules/packages.nix b/nixos/system/modules/packages.nix new file mode 100644 index 0000000..c311e37 --- /dev/null +++ b/nixos/system/modules/packages.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + bat + btop + eza + fzf + git + gnumake + lm_sensors + libsForQt5.qt5.qtquickcontrols2 + libsForQt5.qt5.qtgraphicaleffects + libsForQt5.qt5.qtsvg + neofetch + neovim + ripgrep + tldr + unzip + openssl + openssl.dev + pkg-config + wget + xfce.thunar + xdg-desktop-portal-gtk + xdg-desktop-portal-wlr + zip + zoxide + ]; +} diff --git a/nixos/system/modules/polkit.nix b/nixos/system/modules/polkit.nix new file mode 100644 index 0000000..506921e --- /dev/null +++ b/nixos/system/modules/polkit.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: + +{ + 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; + }; + }; + extraConfig = '' + DefaulTimeoutStopSec=10s + ''; + }; + + environment.systemPackages = with pkgs; [ + polkit + polkit_gnome + ]; +} diff --git a/nixos/system/modules/programs.nix b/nixos/system/modules/programs.nix new file mode 100644 index 0000000..ec51351 --- /dev/null +++ b/nixos/system/modules/programs.nix @@ -0,0 +1,57 @@ +{ config, pkgs, ... }: + +{ + xdg.portal = { + enable = true; + wlr.enable = true; + xdgOpenUsePortal = false; + extraPortals = [ + pkgs.xdg-desktop-portal-hyprland + pkgs.xdg-desktop-portal-gtk + ]; + }; + + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + }; + + zsh = { + enable = true; + }; + + hyprland = { + enable = true; + + xwayland = { + enable = true; + }; + + portalPackage = pkgs.xdg-desktop-portal-hyprland; + }; + + gnupg = { + agent = { + enable = true; + enableSSHSupport = true; + }; + }; + + tmux = { + enable = true; + escapeTime = 0; + + # plugins = with pkgs; [ + # tmuxPlugins.vim-timux-navigator + # tmuxPlugins.resurrect + # tmuxPlugins.continuum + # tmuxPlugins.catppuccin + # ]; + + # zsh.enable = true; + # mtr.enable = true; + }; + }; +} diff --git a/nixos/system/modules/sddm-theme.nix b/nixos/system/modules/sddm-theme.nix new file mode 100644 index 0000000..f372c18 --- /dev/null +++ b/nixos/system/modules/sddm-theme.nix @@ -0,0 +1,15 @@ +{ pkgs }: + +pkgs.stdenv.mkDerivation { + name = "sddm-theme"; + src = pkgs.fetchFromGitHub { + owner = "gpskwlkr"; + repo = "sddm-astronaut-theme"; + rev = "468a100460d5feaa701c2215c737b55789cba0fc"; + sha256 = "1h20b7n6a4pbqnrj22y8v5gc01zxs58lck3bipmgkpyp52ip3vig"; + }; + installPhase = '' + mkdir -p $out + cp -R ./* $out/ + ''; +} diff --git a/nixos/system/modules/security.nix b/nixos/system/modules/security.nix new file mode 100644 index 0000000..fcb3092 --- /dev/null +++ b/nixos/system/modules/security.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + security.polkit.enable = true; + security.pam.services.swaylock = {}; + security.pam.services.swaylock.fprintAuth = false; +} diff --git a/nixos/system/modules/services.nix b/nixos/system/modules/services.nix new file mode 100644 index 0000000..844ff47 --- /dev/null +++ b/nixos/system/modules/services.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: + +{ + services = { + dbus.enable = true; + picom.enable = true; + openssh.enable = true; + spice-vdagentd.enable = true; + + xserver = { + enable = true; + layout = "gb, us, ro"; + xkbOptions = "grp:alt_shift_toggle, caps:swapescape"; + + displayManager = { + sddm.enable = true; + sddm.theme = "${import ./sddm-theme.nix { inherit pkgs; }}"; + }; + }; + }; +} diff --git a/nixos/system/modules/sound.nix b/nixos/system/modules/sound.nix new file mode 100644 index 0000000..1d9b50a --- /dev/null +++ b/nixos/system/modules/sound.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +{ + sound.enable = true; + security.rtkit.enable = true; + hardware.pulseaudio.enable = false; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + wireplumber.enable = true; + }; + + environment.systemPackages = with pkgs; [ + pamixer + pavucontrol + ]; +} diff --git a/nixos/system/modules/theme.nix b/nixos/system/modules/theme.nix new file mode 100644 index 0000000..8204de4 --- /dev/null +++ b/nixos/system/modules/theme.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + gnome3.adwaita-icon-theme + glib + gsettings-desktop-schemas + nwg-look + ]; +} diff --git a/nixos/system/modules/time.nix b/nixos/system/modules/time.nix new file mode 100644 index 0000000..0aa3ce4 --- /dev/null +++ b/nixos/system/modules/time.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + time.timeZone = "Europe/London"; +} diff --git a/nixos/system/modules/users.nix b/nixos/system/modules/users.nix new file mode 100644 index 0000000..be74a80 --- /dev/null +++ b/nixos/system/modules/users.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ + users.users.chris = { + isNormalUser = true; + shell = pkgs.zsh; + extraGroups = [ + "wheel" + "docker" + "qemu" + "kvm" + "libvirtd" + "networkmanager" + ]; + }; +} diff --git a/nixos/system/modules/virtualisation.nix b/nixos/system/modules/virtualisation.nix new file mode 100644 index 0000000..7efa682 --- /dev/null +++ b/nixos/system/modules/virtualisation.nix @@ -0,0 +1,36 @@ +{ pkgs, ... }: + +{ + virtualisation = { + spiceUSBRedirection.enable = true; + + libvirtd = { + enable = true; + + qemu = { + swtpm.enable = true; + ovmf.enable = true; + # ovmf.packages = [ pkgs.OVMFFULL.fd ]; + }; + }; + + podman = { + enable = true; + + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + }; + + environment.systemPackages = with pkgs; [ + podman-compose + qemu + spice + spice-gtk + spice-protocol + virt-manager + virt-viewer + win-spice + win-virtio + ]; +}