Johan Rong 6 hónapja
commit
188dabe382

+ 2 - 0
README.md

@@ -0,0 +1,2 @@
+# Nix dots
+- Thanks to [kaleocheng/nix-dots](https://github.com/kaleocheng/nix-dots/) for the base idea/structure.

+ 17 - 0
config/hosts.nix

@@ -0,0 +1,17 @@
+let
+  users = import ./users.nix;
+in
+{
+  nixstation = {
+    hostname = "nixstation";
+    dir = "desktop-nixos-workstation";
+    arch = "x86_64-linux";
+    user = users.default;
+  };
+  nixtop = {
+    hostname = "nixtop";
+    dir = "laptop-nixos-dell";
+    arch = "x86_64-linux";
+    user = users.default;  
+  };
+}

+ 3 - 0
config/users.nix

@@ -0,0 +1,3 @@
+{
+  default = "johron";
+}

+ 49 - 0
flake.lock

@@ -0,0 +1,49 @@
+{
+  "nodes": {
+    "home-manager": {
+      "inputs": {
+        "nixpkgs": [
+          "nixpkgs"
+        ]
+      },
+      "locked": {
+        "lastModified": 1771744638,
+        "narHash": "sha256-EDLi+YAsEEAmMeZe1v6GccuGRbCkpSZp/+A6g+pivR8=",
+        "owner": "nix-community",
+        "repo": "home-manager",
+        "rev": "cb6c151f5c9db4df0b69d06894dc8484de1f16a0",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-community",
+        "ref": "release-25.11",
+        "repo": "home-manager",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1771903837,
+        "narHash": "sha256-sdaqdnsQCv3iifzxwB22tUwN/fSHoN7j2myFW5EIkGk=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "ref": "nixos-25.11",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "home-manager": "home-manager",
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}

+ 86 - 0
flake.nix

@@ -0,0 +1,86 @@
+{
+  description = "Nix Dotsfiles with flake";
+
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
+    home-manager = {
+      url = "github:nix-community/home-manager/release-25.11";
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
+  };
+
+  outputs =
+    {
+      self,
+      ...
+    }@inputs:
+
+    let
+      hosts = import ./config/hosts.nix;
+
+      mkHomeConfigurations =
+        {
+          host,
+          nixpkgs,
+          home-manager,
+          modules ? [ ],
+        }:
+        home-manager.lib.homeManagerConfiguration {
+          pkgs = import nixpkgs {
+            system = host.arch;
+            config = {
+              allowUnfree = true;
+            };
+          };
+          modules = [
+            ./hosts/${host.dir}/home.nix
+          ] ++ modules;
+        };
+
+      mkNixOSConfigurations =
+        {
+          host,
+          nixpkgs,
+          home-manager,
+          modules ? [ ],
+          overlays ? [ ],
+        }:
+        nixpkgs.lib.nixosSystem {
+          system = host.arch;
+          modules = [
+            ./hosts/${host.dir}/configuration.nix
+            { nixpkgs.overlays = overlays; }
+            home-manager.nixosModules.home-manager
+            {
+              home-manager.useGlobalPkgs = true;
+              home-manager.users."${host.user}" = import ./hosts/${host.dir}/home.nix;
+            }
+          ] ++ modules;
+        };
+
+    in
+    {
+      nixosConfigurations."${hosts.nixstation.hostname}" = mkNixOSConfigurations {
+        host = hosts.nixstation;
+        nixpkgs = inputs.nixpkgs;
+        home-manager = inputs.home-manager;
+      };
+      nixosConfigurations."${hosts.nixtop.hostname}" = mkNixOSConfigurations {
+        host = hosts.nixtop;
+        nixpkgs = inputs.nixpkgs;
+        home-manager = inputs.home-manager;
+      };
+
+      #homeConfigurations."${hosts.workstation.user}@${hosts.workstation.hostname}" = mkHomeConfigurations {
+      #  host = hosts.workstation;
+      #  nixpkgs = inputs.nixpkgs;
+      #  home-manager = inputs.home-manager;
+      #};
+
+      #homeConfigurations."${hosts.wsl.hostname}" = mkHomeConfigurations {
+      #  host = hosts.wsl;
+      #  nixpkgs = inputs.nixpkgs-stable;
+      #  home-manager = inputs.home-manager-stable;
+      #};
+    };
+}

+ 64 - 0
home/features/application/alacritty.nix

@@ -0,0 +1,64 @@
+{ pkgs, lib, ... }:
+{
+  programs.alacritty = {
+    enable = true;
+    settings = {
+      cursor = {
+        style = {
+          shape = "Beam";
+          blinking = "On";
+        };
+      };
+      font = {
+        size = 10.0;
+        normal = {
+          family = "JetBrains Mono";
+          style = "Regular";
+        };
+
+        bold = {
+          family = "JetBrains Mono";
+          style = "Bold";
+        };
+
+        italic = {
+          family = "JetBrains Mono";
+          style = "Italic";
+        };
+
+        bold_italic = {
+          family = "JetBrains Mono";
+          style = "Bold Italic";
+        };
+      };
+      colors = { # Enfocado Dark colorscheme
+        primary = {
+          background =  "#181818";
+          foreground =  "#b9b9b9";
+        };
+
+        normal = {
+          black   = "#3b3b3b";
+          red     = "#ed4a46";
+          green   = "#70b433";
+          yellow  = "#dbb32d";
+          blue    = "#368aeb";
+          magenta = "#eb6eb7";
+          cyan    = "#3fc5b7";
+          white   = "#b9b9b9";
+        };
+
+        bright = {
+          black   = "#777777";
+          red     = "#ff5e56";
+          green   = "#83c746";
+          yellow  = "#efc541";
+          blue    = "#4f9cfe";
+          magenta = "#ff81ca";
+          cyan    = "#56d8c9";
+          white   = "#dedede";
+        };
+      };
+    };
+  };
+}

+ 20 - 0
home/features/application/breeze-dark.nix

@@ -0,0 +1,20 @@
+{ pkgs, lib, ... }:
+{
+  home.packages = with pkgs; [
+    kdePackages.breeze
+    kdePackages.breeze-gtk
+    kdePackages.breeze-icons
+  ];
+
+  gtk = {
+    enable = true;
+    theme = {
+      name = "Breeze-Dark";
+      package = pkgs.kdePackages.breeze-gtk;
+    };
+    iconTheme = {
+      name = "breeze-dark";
+      package = pkgs.kdePackages.breeze-icons;
+    };
+  };
+}

+ 105 - 0
home/features/application/files.nix

@@ -0,0 +1,105 @@
+{ pkgs, lib, ... }:
+{
+  home = {
+    file = {
+      bashrc = {
+        target = ".bashrc";
+        text = ''
+          current_git_branch() {
+            git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
+          }
+          shlvl_prompt() {
+            (( SHLVL > 1 )) && printf '(%d)' "$SHLVL"
+          }
+          PS1='$(shlvl_prompt)(\[\033[01;94m\]\u\[\033[00;00m\]@\[\033[01;94m\]\h\[\033[00;00m\]:\[\033[01;34m\]\w\[\033[00m\])\[\033[01;32m\]$(current_git_branch)\[\033[00m\]$ '
+          alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
+          home() {
+            cd "$HOME/home-manager"
+            "$EDITOR" "$HOME/home-manager/home.nix"
+          }
+          flake() {
+            cd "$HOME/home-manager"
+            "$EDITOR" "$HOME/home-manager/flake.nix"
+          }
+          config() {
+            "sudo" "$EDITOR" "/etc/nixos/configuration.nix"
+          }
+          nix-update() {
+            set -e
+
+            ORIG_CWD="$(pwd)"
+
+            sudo nix-channel --update
+            cd "$HOME/home-manager"
+            make
+            sudo nixos-rebuild switch
+            flatpak update -y
+            sudo flatpak update -y
+            cd "$ORIG_CWD"
+          }
+          jclone() {
+            git clone https://github.com/johron/$1
+          }
+        '';
+      };
+      flameshot = {
+        target = ".config/flameshot/flameshot.ini";
+        text = ''
+          [General]
+          contrastOpacity=188
+          showAbortNotification=false
+          showDesktopNotification=false
+          showStartupLaunchMessage=false
+          savePath=/home/johron/Pictures/Screenshots
+          savePathFixed=true
+        '';
+      };
+      mako = {
+        target = ".config/mako/config";
+        text = ''
+          default-timeout=5000
+        '';
+      };
+      clock = {
+        target = ".config/waybar/clock.sh";
+        text = ''
+        # Generate the formatted date string
+        formatted_date=$(LC_TIME=nb_NO.UTF-8 date +"%H:%M %A, %b %d" | tr '[:upper:]' '[:lower:]' | sed 's/\.//g')
+
+        # Output as JSON for Waybar
+        printf '{"text": "%s"}\n' "$formatted_date"
+        '';
+        executable = true;
+      };
+      memory = {
+        target = ".config/waybar/memory.sh";
+        text = ''
+          free -m | awk '
+          /^Mem:/ {
+              current_gb = $3 / 1024;
+              total_gb = $2 / 1024;
+              printf "{\"text\": \"%.1fG/%.1fG\"}\n", current_gb, total_gb
+          }'
+        '';
+        executable = true;
+      };
+      volume = {
+        target = ".config/waybar/volume.sh";
+        text = ''
+          VOLUME_INFO=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
+          VOL_NUM=$(echo "$VOLUME_INFO" | awk '{print $2}')
+          VOL_PERC=$(awk -v n="$VOL_NUM" 'BEGIN {print int(n * 100)}')
+
+          if [[ "$VOLUME_INFO" == *"[MUTED]"* ]]; then
+              RESULT="Muted ($VOL_PERC%)"
+          else
+              RESULT="$VOL_PERC%"
+          fi
+
+          echo "{\"text\": \"$RESULT\"}"
+        '';
+        executable = true;
+      };
+    };
+  };
+}

+ 18 - 0
home/features/application/mako.nix

@@ -0,0 +1,18 @@
+{ pkgs, lib, ... }:
+{
+  home = {
+    packages = with pkgs; [
+      mako
+      libnotify
+    ];
+
+    file = {
+      mako = {
+        target = ".config/mako/config";
+        text = ''
+          default-timeout=5000
+        '';
+      };
+    };
+  };
+}

+ 26 - 0
home/features/application/notwaita.nix

@@ -0,0 +1,26 @@
+{ pkgs, lib, ... }:
+
+let
+  notwaitaBlackSrc = pkgs.fetchurl {
+    url = "https://github.com/ful1e5/notwaita-cursor/releases/download/v1.0.0-alpha1/Notwaita-Black.tar.xz";
+    sha256 = "sha256-P/F4NRBqz/6Ws9//qEKMYdqtfG5LdZa6jihqueZnx88==";
+  };
+
+  notwaitaBlackCursor = pkgs.runCommand "notwaita-black-cursor" {
+    nativeBuildInputs = [ pkgs.xz pkgs.gnutar ];
+  } ''
+    mkdir -p $out/share/icons
+    tar -xJf ${notwaitaBlackSrc} -C $out/share/icons
+  '';
+in
+{
+  home = {
+    pointerCursor = {
+      package = notwaitaBlackCursor;
+      name = "Notwaita-Black";
+      size = 20; # adjust size you want
+      gtk.enable = true;
+      x11.enable = true;
+    };
+  };
+}

+ 26 - 0
home/features/application/rofi.nix

@@ -0,0 +1,26 @@
+{ pkgs, lib, ... }:
+
+let
+  rofiRepo = builtins.fetchTarball {
+    url = "https://github.com/johron/adi1090x-rofi/archive/refs/heads/master.tar.gz";
+    sha256 = "02svplixyy6i3x28qjj0hb7lp4xl42a93iz342vibjz8665ajjwb";
+  };
+in
+{
+  programs.rofi = {
+    enable = true;
+    package = pkgs.rofi;
+    theme = "launchers/type-4/style-5.rasi";
+  };
+
+  home = {
+    file = {
+      "/.config/rofi/launchers".source = "${rofiRepo}/files/launchers";
+      "/.config/rofi/applets".source   = "${rofiRepo}/files/applets";
+      "/.config/rofi/colors".source    = "${rofiRepo}/files/colors";
+      "/.config/rofi/images".source    = "${rofiRepo}/files/images";
+      "/.config/rofi/powermenu".source = "${rofiRepo}/files/powermenu";
+      "/.config/rofi/scripts".source   = "${rofiRepo}/files/scripts";
+    };
+  };
+}

+ 215 - 0
home/features/application/sway/default.nix

@@ -0,0 +1,215 @@
+{ pkgs, lib, ... }:
+
+let
+  left = "j";
+  up = "k";
+  down = "l";
+  right = "oslash";
+  mod = "Mod1";
+  super = "Super";
+in
+{
+  imports = [
+    ./waybar.nix
+  ];
+
+  home.packages = with pkgs; [
+    
+  ];
+
+  wayland.windowManager.sway = {
+      enable = true;
+      checkConfig = true;
+      config = {
+        bars = [
+          {
+            command = "swaybar_command waybar";
+          }
+        ];
+        modes = {
+          resize = {
+            # Letters
+            ${left} = "resize shrink width 10 px or 10 ppt";
+            ${up} = "resize grow height 10 px or 10 ppt";
+            ${down} = "resize shrink height 10 px or 10 ppt";
+            ${right} = "resize grow width 10 px or 10 ppt";
+
+            # Arrow keys
+            "Left"  = "resize shrink width 10 px or 10 ppt";
+            "Down"  = "resize grow height 10 px or 10 ppt";
+            "Up"    = "resize shrink height 10 px or 10 ppt";
+            "Right" = "resize grow width 10 px or 10 ppt";
+
+            # Exit mode
+            "Escape" = "mode default";
+            "Return" = "mode default";
+          };
+        };
+        keybindings = {
+          "${mod}+Shift+r" = "reload";
+          "${mod}+Shift+q" = "kill";
+          "${mod}+d" = "exec rofi -show drun";
+          "${mod}+Return" = "exec alacritty";
+          "${super}+l" = "exec swaylock";
+          "${mod}+r" = "mode \"resize\"";
+
+          "${mod}+Shift+e" = "exec /home/johron/.config/rofi/powermenu/type-1/powermenu.sh";
+
+          "${mod}+h" = "split h";
+          "${mod}+v" = "split v";
+          "${mod}+f" = "fullscreen toggle";
+          "${mod}+s" = "layout stacking";
+          "${mod}+t" = "layout tabbed";
+          "${mod}+e" = "layout toggle split";
+
+          "${mod}+Shift+space" = "floating toggle";
+          "${mod}+space" = "focus mode_toggle";
+          "${mod}+a" = "focus parent";
+
+          # Focus movement
+          "${mod}+${left}" = "focus left";
+          "${mod}+${down}" = "focus down";
+          "${mod}+${up}" = "focus up";
+          "${mod}+${right}" = "focus right";
+
+          # Focus movement (arrow keys)
+          "${mod}+Left" = "focus left";
+          "${mod}+Down" = "focus down";
+          "${mod}+Up" = "focus up";
+          "${mod}+Right" = "focus right";
+
+          # Move windows
+          "${mod}+Shift+${left}" = "move left";
+          "${mod}+Shift+${down}" = "move down";
+          "${mod}+Shift+${up}" = "move up";
+          "${mod}+Shift+${right}" = "move right";
+
+          # Move windows (arrow keys)
+          "${mod}+Shift+Left" = "move left";
+          "${mod}+Shift+Down" = "move down";
+          "${mod}+Shift+Up" = "move up";
+          "${mod}+Shift+Right" = "move right";
+
+          # Switch to workspace
+          "${mod}+1" = "workspace number 1";
+          "${mod}+2" = "workspace number 2";
+          "${mod}+3" = "workspace number 3";
+          "${mod}+4" = "workspace number 4";
+          "${mod}+5" = "workspace number 5";
+          "${mod}+6" = "workspace number 6";
+          "${mod}+7" = "workspace number 7";
+          "${mod}+8" = "workspace number 8";
+          "${mod}+9" = "workspace number 9";
+          "${mod}+0" = "workspace number 10";
+
+          ## Switch to secondary workspace
+          "${super}+1" = "workspace number 11";
+          "${super}+2" = "workspace number 12";
+          "${super}+3" = "workspace number 13";
+          "${super}+4" = "workspace number 14";
+          "${super}+5" = "workspace number 15";
+          "${super}+6" = "workspace number 16";
+          "${super}+7" = "workspace number 17";
+          "${super}+8" = "workspace number 18";
+          "${super}+9" = "workspace number 19";
+          "${super}+0" = "workspace number 20";
+
+          # Move to workspace
+          "${mod}+Shift+1" = "move container to workspace number 1";
+          "${mod}+Shift+2" = "move container to workspace number 2";
+          "${mod}+Shift+3" = "move container to workspace number 3";
+          "${mod}+Shift+4" = "move container to workspace number 4";
+          "${mod}+Shift+5" = "move container to workspace number 5";
+          "${mod}+Shift+6" = "move container to workspace number 6";
+          "${mod}+Shift+7" = "move container to workspace number 7";
+          "${mod}+Shift+8" = "move container to workspace number 8";
+          "${mod}+Shift+9" = "move container to workspace number 9";
+          "${mod}+Shift+0" = "move container to workspace number 10";
+
+          ## Move to secondary workspace
+          "${super}+Shift+1" = "move container to workspace number 11";
+          "${super}+Shift+2" = "move container to workspace number 12";
+          "${super}+Shift+3" = "move container to workspace number 13";
+          "${super}+Shift+4" = "move container to workspace number 14";
+          "${super}+Shift+5" = "move container to workspace number 15";
+          "${super}+Shift+6" = "move container to workspace number 16";
+          "${super}+Shift+7" = "move container to workspace number 17";
+          "${super}+Shift+8" = "move container to workspace number 18";
+          "${super}+Shift+9" = "move container to workspace number 19";
+          "${super}+Shift+0" = "move container to workspace number 20";
+
+          # Multimedia
+          XF86AudioMute = "exec wpctl set-mute @DEFAULT_SINK@ toggle";
+          XF86AudioPlay = "exec playerctl play-pause";
+          XF86AudioPause = "exec playerctl pause";
+          XF86AudioNext = "exec playerctl next";
+          XF86AudioPrev = "exec playerctl previous";
+          XF86AudioRaiseVolume = "exec wpctl set-volume @DEFAULT_SINK@ 5%+";
+          XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_SINK@ 5%-";
+
+          # Applications
+          "${super}+q" = "exec firefox";
+          "${super}+e" = "exec nemo";
+          "${super}+s" = "exec spotify";
+          "${super}+d" = "exec discord";
+
+          "${super}+v" = "exec cliphist list | rofi -dmenu | cliphist decode | wl-copy";
+          "${super}+Shift+s" = "exec flameshot gui";
+          "${super}+Shift+c" = "exec hyprpicker --autocopy";
+
+          # Scripts
+          "${mod}+dead_diaeresis" = "exec /storage/Scripts/rofi-audio";
+          "${mod}+Control+a" = "exec /storage/Scripts/toggle-mic-mute";
+          "${mod}+Control+s" = "exec /storage/Scripts/toggle-output-mute";
+        };
+
+        window.commands = [
+          { command = "floating enable"; criteria.instance = "spotify"; }
+          #{ command = "floating enable"; criteria.class = "steam"; }
+        ];
+
+        input = {
+          "*" = {
+           xkb_layout = "no";
+           #xkb_variant = "cole";
+        };
+      };
+    };
+    extraConfig = ''
+      output DP-2 pos 0 0 mode 1920x1080@143.981Hz
+      output HDMI-A-1 mode 1920x1080@143.981Hz
+
+      workspace 1 output DP-2
+      workspace 2 output DP-2
+      workspace 3 output DP-2
+
+      workspace 11 output HDMI-A-1
+      workspace 12 output HDMI-A-1
+      workspace 13 output HDMI-A-1
+
+      exec wl-paste --watch cliphist store
+      exec flameshot
+
+      seat seat0 xcursor_theme Notwaita-Black 20
+
+      ## Bind Alt+Shift+e to show a Swaynag exit confirmation
+      #bindsym Mod1+Shift+e exec swaynag -t warning \
+      #  -m "Are you sure you want to exit Sway?" \
+      #  -b "Exit" "swaymsg exit" \
+      #  -b "Reboot" "reboot"
+
+      #exec mpvpaper -o "--loop=inf" ALL /home/johron/Videos/cubebg.mp4
+
+      exec swaybg -i "$HOME/Pictures/Backgrounds/reef-1920x1080-2.png" -m fill
+
+      exec_always {
+        systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
+        lxqt-policykit-agent
+        swayidle \
+          timeout 600 'swaylock -f' \
+          timeout 1200 'systemctl suspend' \
+          before-sleep 'swaylock -f'
+      }
+    '';
+  };
+}

+ 47 - 0
home/features/application/sway/scripts.nix

@@ -0,0 +1,47 @@
+{ pkgs, lib, ... }:
+{
+  home = {
+    file = {
+      clock = {
+        target = ".config/waybar/clock.sh";
+        text = ''
+        # Generate the formatted date string
+        formatted_date=$(LC_TIME=nb_NO.UTF-8 date +"%H:%M %A, %b %d" | tr '[:upper:]' '[:lower:]' | sed 's/\.//g')
+
+        # Output as JSON for Waybar
+        printf '{"text": "%s"}\n' "$formatted_date"
+        '';
+        executable = true;
+      };
+      memory = {
+        target = ".config/waybar/memory.sh";
+        text = ''
+          free -m | awk '
+          /^Mem:/ {
+              current_gb = $3 / 1024;
+              total_gb = $2 / 1024;
+              printf "{\"text\": \"%.1fG/%.1fG\"}\n", current_gb, total_gb
+          }'
+        '';
+        executable = true;
+      };
+      volume = {
+        target = ".config/waybar/volume.sh";
+        text = ''
+          VOLUME_INFO=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
+          VOL_NUM=$(echo "$VOLUME_INFO" | awk '{print $2}')
+          VOL_PERC=$(awk -v n="$VOL_NUM" 'BEGIN {print int(n * 100)}')
+
+          if [[ "$VOLUME_INFO" == *"[MUTED]"* ]]; then
+              RESULT="Muted ($VOL_PERC%)"
+          else
+              RESULT="$VOL_PERC%"
+          fi
+
+          echo "{\"text\": \"$RESULT\"}"
+        '';
+        executable = true;
+      };
+    };
+  };
+}

+ 167 - 0
home/features/application/sway/waybar.nix

@@ -0,0 +1,167 @@
+{ pkgs, lib, ... }:
+{
+  imports = [
+    ./scripts.nix
+  ];
+
+  programs.waybar = {
+    enable = true;
+    settings = {
+      main = {
+        position = "bottom";
+        layer = "top";
+        exclusive = "false";
+        height = 30;
+        spacing = 5;
+        modules-left = [ "custom/block_start" "sway/workspaces" "mpris" "custom/block_stop" "sway/mode" ];
+        modules-center = [ "custom/block_start" "custom/clock" "custom/block_stop" ];
+        modules-right = [ "custom/block_start" "custom/memory" "custom/slash" "custom/volume" "custom/block_stop" "tray" ];
+
+        "mpris" = {
+          player = "spotify";
+          format = "<span color=\"#272727\">/</span> <span color=\"#ACA69E\">mus:</span> {artist} - {title}";
+          format-paused = "<span color=\"#272727\">/</span> <span color=\"#ACA69E\">mus:</span> {artist}";
+          max-length = 200;
+        };
+
+        "sway/workspaces" = {
+          format = "{icon}{name}";
+          on-click = "activate";
+          icon-size = 10;
+          sort-by-number = "true";
+          justify = "right";
+          "format-icons" = {
+            focused = "*";
+            urgent = "!";
+            default = "";
+          };
+        };
+
+        "custom/space" = {
+          format = " ";
+        };
+
+        "custom/slash" = {
+          format = "/ ";
+        };
+
+        "custom/block_start" = {
+          format = " [";
+        };
+
+        "custom/block_stop" = {
+          format = "] ";
+        };
+
+        "custom/clock" = {
+          format = "{}";
+          exec = "~/.config/waybar/clock.sh";
+          return-type = "json";
+          restart-interval = 1;
+        };
+
+        "battery" = {
+          bat = "BAT1";
+          interval = 60;
+          format = "{icon} {capacity}%";
+          format-icons = ["\uf244" "\uf243" "\uf242" "\uf241" "\uf240"];
+        };
+
+        "custom/volume" = {
+          format = "<span color=\"#ACA69E\">vol:</span> {} ";
+          exec = "~/.config/waybar/volume.sh";
+          return-type = "json";
+          restart-interval = 0;
+        };
+
+        "custom/memory" = {
+          format = "<span color=\"#ACA69E\">mem:</span> {} ";
+          exec = "~/.config/waybar/memory.sh";
+          return-type = "json";
+          restart-interval = 1;
+        };
+
+        "custom/lang" = {
+          format = "<span color=\"#ACA69E\">key:</span> no";
+        };
+
+        "tray" = {
+          icon-size = 16;
+          spacing = 16;
+        };
+      };
+    };
+    style = ''
+      @define-color foreground #ACA69E;
+      @define-color foreground-inactive #ffffff;
+      @define-color background #101010;
+
+      * {
+        font-family: JetBrainsMono Nerd Font;
+        font-size: 12px;
+      }
+
+      #waybar {
+        color: #ffffff;
+        background-color: @background;
+      }
+
+      #workspaces {
+        background: transparent;
+      }
+
+      #custom-slash,
+      #custom-block_start,
+      #custom-block_stop {
+        color: #272727;
+      }
+
+      #workspaces button {
+        min-width: 20px;
+        padding: 0 0.6em;
+        margin: 0 0.2em;
+        color: @foreground-inactive;
+
+        background: transparent;
+        border: none;
+        border-bottom: 2px solid transparent;
+        border-radius: 0;
+        padding: 0px;
+        margin: 0 5px;
+      }
+
+      #workspaces button.active,
+      #workspaces button.focused {
+        color: #ACA69E;
+        /*border-bottom: 2px solid @foreground;*/
+      }
+
+      #workspaces button.empty {
+        color: #ACA69E;
+      }
+
+      #workspaces button.urgent {
+        color: #A64443;
+      }
+
+      #workspaces button:hover {
+        color: @foreground;
+      }
+
+      #mode {
+        color: #A64443;
+      }
+
+      #memory,
+      #wireplumber,
+      #battery,
+      #idle_inhibitor,
+      #language,
+      #network,
+      #bluetooth,
+      #tray {
+        padding-right: 1em
+      }
+    '';
+  };
+}

+ 24 - 0
home/flavors/application/development/default.nix

@@ -0,0 +1,24 @@
+{ pkgs, lib, ... }:
+{
+  imports = [
+
+  ];
+
+  home.packages = with pkgs; [
+    jetbrains.idea
+    jetbrains.rust-rover
+    google-cloud-sdk
+    ninja
+    godot-mono
+    ida-free
+    gdb
+    flatpak-xdg-utils
+    vscode
+    cargo
+    rustc
+    rustfmt
+    rustPlatform.rustLibSrc
+    rust-analyzer
+    lua51Packages.lua
+  ];
+}

+ 21 - 0
home/flavors/application/workstation/default.nix

@@ -0,0 +1,21 @@
+{ pkgs, lib, ... }:
+{
+  imports = [
+
+  ];
+
+  home.packages = with pkgs; [
+    spotify
+    discord
+    feishin
+    kdePackages.kdenlive
+    kdePackages.ark
+    kdePackages.dolphin
+    google-cloud-sdk
+    obsidian
+    vlc
+    inkscape
+    f3d
+    geogebra6
+  ];
+}

+ 10 - 0
home/flavors/desktop/sway/default.nix

@@ -0,0 +1,10 @@
+{ pkgs, lib, ... }:
+{
+  imports = [
+    ../../../features/application/sway
+    ../../../features/application/mako.nix
+    ../../../features/application/rofi.nix
+    ../../../features/application/notwaita.nix
+    ../../../features/application/breeze-dark.nix
+  ];
+}

+ 55 - 0
hosts/desktop-nixos-workstation/configuration.nix

@@ -0,0 +1,55 @@
+{ config, pkgs, lib, ... }:
+
+let
+  user = "johron";
+  storageRoot = "/storage";
+
+  folders = [
+    "Applications"
+    "Documents"
+    "Downloads"
+    "Games"
+    "Machines"
+    "Music"
+    "Pictures"
+    "Projects"
+    "Scripts"
+    "Videos"
+    "Wineprefixes"
+  ];
+
+  mkBindMount = folder: {
+    name = "/home/${user}/${folder}";
+    value = {
+      device = "${storageRoot}/${folder}";
+      options = [ "bind" "nofail" "x-systemd.automount" ];
+      depends = [ storageRoot ];
+    };
+  };
+in
+{
+  imports = [
+    ./networking.nix
+    ./hardware-configuration.nix
+
+    ../../nixos/hardware/gpu/nvidia.nix
+    ../../nixos/hardware/wifi/bcm4360.nix
+    ../../nixos/hardware/sound
+    ../../nixos/flavors/desktop/sway
+    ../../nixos/flavors/desktop/sway/greeter-default.nix
+    ../../nixos/features/system/basic.nix
+    ../../nixos/features/system/users.nix
+    ../../nixos/features/system/gaming.nix
+  ];
+
+  nixpkgs.config.allowUnfree = true;
+
+  nix.settings.experimental-features = [ "nix-command" "flakes" ];
+  fileSystems = lib.mkMerge [
+    (builtins.listToAttrs (map mkBindMount folders))
+  ];
+
+  boot.loader.systemd-boot.enable = true;
+  boot.loader.efi.canTouchEfiVariables = true;
+  system.stateVersion = "25.11";
+}

+ 58 - 0
hosts/desktop-nixos-workstation/hardware-configuration.nix

@@ -0,0 +1,58 @@
+# 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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-amd" ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/40f01d77-f742-494a-bd9d-05c691619578";
+      fsType = "btrfs";
+      options = [ "subvol=@" ];
+    };
+
+  fileSystems."/home" =
+    { device = "/dev/disk/by-uuid/40f01d77-f742-494a-bd9d-05c691619578";
+      fsType = "btrfs";
+      options = [ "subvol=@home" ];
+    };
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/DC2D-30C4";
+      fsType = "vfat";
+      options = [ "fmask=0077" "dmask=0077" ];
+    };
+
+  fileSystems."/hdd" =
+    { device = "/dev/disk/by-uuid/995f3a39-f893-497d-bc2a-c0cb1f4c913c";
+      fsType = "ext4";
+    };
+
+  fileSystems."/nix" =
+    { device = "/dev/disk/by-uuid/08162bfa-f48f-4b7c-8bf0-2a38e92810de";
+      fsType = "btrfs";
+    };
+
+  fileSystems."/nvme" =
+    { device = "/dev/disk/by-uuid/aa535a01-d005-4fd2-9e95-3787ce33b6f3";
+      fsType = "btrfs";
+    };
+
+  fileSystems."/storage" =
+    { device = "/dev/disk/by-uuid/6f208e9e-ec40-4107-803d-d8f381a31e40";
+      fsType = "btrfs";
+    };
+
+  swapDevices = [ ];
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}

+ 22 - 0
hosts/desktop-nixos-workstation/home.nix

@@ -0,0 +1,22 @@
+{ config, pkgs, ... }:
+let
+  users = import ../../config/users.nix;
+in
+{
+  imports = [
+    ../../home/flavors/desktop/sway
+    ../../home/flavors/application/workstation
+    ../../home/flavors/application/development
+  ];
+
+  news.display = "silent";
+
+  #nixpkgs.config.allowUnfree = true;
+
+  home = {
+    username = users.default;
+    homeDirectory = "/home/${users.default}";
+    stateVersion = "25.11";
+  };
+
+}

+ 8 - 0
hosts/desktop-nixos-workstation/networking.nix

@@ -0,0 +1,8 @@
+{ config, pkgs, ... }:
+let
+  hosts = import ../../config/hosts.nix;
+in
+
+{
+  networking.hostName = hosts.nixstation.hostname;
+}

+ 86 - 0
nixos/features/system/basic.nix

@@ -0,0 +1,86 @@
+{ config, pkgs, ... }:
+
+{
+  environment.systemPackages = with pkgs; [
+    lf
+    jq
+    gh
+    git
+    wget
+    wine
+    curl
+    htop
+    unzip
+    seatd
+    #polkit
+    libgcc
+    gnumake
+    gparted
+    flatpak
+    dnsmasq
+    pciutils
+    onefetch
+    python315
+    playerctl
+    p7zip-rar
+    fastfetch
+    pkg-config
+    kdePackages.qt6ct
+    lxqt.lxqt-policykit
+    xdg-desktop-portal-wlr
+  ];
+
+  fonts = {
+    packages = with pkgs; [
+      adwaita-fonts
+      jetbrains-mono
+      nerd-fonts.jetbrains-mono
+    ];
+    fontconfig = {
+      defaultFonts = {
+        sansSerif = [ "Adwaita Sans" ];
+        monospace = [ "JetBrains Mono" "Adwaita Mono" ];
+      };
+    };
+  };
+
+  environment.variables = {
+    QT_QPA_PLATFORMTHEME = "qt6ct";
+  };
+
+  services.xserver.xkb = {
+    layout = "no";
+    variant = "winkeys";
+  };
+  console.keyMap = "no";
+
+  time.timeZone = "Europe/Oslo";
+
+  i18n.defaultLocale = "en_US.UTF-8";
+  i18n.extraLocaleSettings = {
+    LC_ADDRESS = "nb_NO.UTF-8";
+    LC_IDENTIFICATION = "nb_NO.UTF-8";
+    LC_MEASUREMENT = "nb_NO.UTF-8";
+    LC_MONETARY = "nb_NO.UTF-8";
+    LC_NAME = "nb_NO.UTF-8";
+    LC_NUMERIC = "nb_NO.UTF-8";
+    LC_PAPER = "nb_NO.UTF-8";
+    LC_TELEPHONE = "nb_NO.UTF-8";
+    LC_TIME = "nb_NO.UTF-8";
+  };
+
+  security.polkit.enable = true;
+
+  programs.nix-ld.enable = true;
+
+  programs.firefox.enable = true;
+
+  services.seatd.enable = true;
+  services.gvfs.enable = true;
+
+  virtualisation.libvirtd.enable = true;
+  programs.virt-manager.enable = true;
+
+  virtualisation.docker.enable = true;
+  virtualisation.docker.storageDriver = "btrfs";
+}

+ 13 - 0
nixos/features/system/gaming.nix

@@ -0,0 +1,13 @@
+{ pkgs, lib, ... }:
+{
+  imports = [
+
+  ];
+
+  environment.systemPackages = with pkgs; [
+    lutris
+    prismlauncher
+  ];
+
+  programs.steam.enable = true;
+}

+ 17 - 0
nixos/features/system/users.nix

@@ -0,0 +1,17 @@
+{ config, pkgs, ... }:
+
+let
+  users = import ../../../config/users.nix;
+in
+{
+  security = {
+    sudo = {
+      wheelNeedsPassword = true;
+    };
+  };
+
+  users.users.${users.default} = {
+    isNormalUser = true;
+    extraGroups = [ "wheel" "video" "audio" "input" "networkmanager" "seat" "libvirtd" "docker" ];
+  };
+}

+ 39 - 0
nixos/flavors/desktop/sway/default.nix

@@ -0,0 +1,39 @@
+{ config, pkgs, ... }:
+{
+  imports = [
+    
+  ];
+
+  environment.systemPackages = with pkgs; [
+    cliphist
+    wl-clipboard
+    mission-center
+    hyprpicker
+    flameshot
+    nomacs
+    nemo
+    gammastep
+    geoclue2
+  ];
+
+  programs.sway = {
+    enable = true;
+    wrapperFeatures.gtk = true;
+    extraPackages = with pkgs; [
+      alacritty
+      swaylock
+      swayidle
+      swaybg
+    ];
+  };
+
+  programs.foot.enable = false;
+
+  environment.variables = {
+    GDK_BACKEND = "wayland";
+    XDG_SESSION_TYPE = "wayland";
+  };
+
+  security.pam.services.swaylock = {};
+  services.gnome.gnome-keyring.enable = true;
+}

+ 22 - 0
nixos/flavors/desktop/sway/greeter-default.nix

@@ -0,0 +1,22 @@
+{ config, pkgs, ... }:
+
+
+let
+  users = import ./../../../../config/users.nix;
+in
+{
+  environment.systemPackages = with pkgs; [
+    tuigreet
+  ];
+
+  security.pam.services.greetd.enableGnomeKeyring = true;
+  services.greetd = {
+    enable = true;
+    settings.default_session = {
+      command = ''
+        ${pkgs.tuigreet}/bin/tuigreet --time --cmd "sway --unsupported-gpu"
+      '';
+      user = users.default;
+    };
+  };
+}

+ 9 - 0
nixos/hardware/bluetooth/default.nix

@@ -0,0 +1,9 @@
+{ pkgs, ... }:
+{
+  imports = [
+    ./kdeconnect.nix
+  ];
+
+  hardware.bluetooth.enable = true;
+  services.blueman.enable = true;
+}

+ 4 - 0
nixos/hardware/bluetooth/kdeconnect.nix

@@ -0,0 +1,4 @@
+{ pkgs, ... }:
+{
+  programs.kdeconnect.enable = true;
+}

+ 35 - 0
nixos/hardware/gpu/nvidia.nix

@@ -0,0 +1,35 @@
+{ config, pkgs, ... }:
+
+{
+  boot.kernelModules = [ "wl" "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
+  boot.kernelParams = [
+    "nvidia.NVreg_PreserveVideoMemoryAllocations=1"
+    "nvidia.NVreg_TemporaryFilePath=/var/tmp"
+    "mem_sleep_default=deep"
+    "nvidia_drm.modeset=1"
+  ];
+
+  services.xserver.videoDrivers = [ "nvidia" ];
+
+  hardware.nvidia = {
+    open = false;
+
+    powerManagement = {
+      enable = false;
+      finegrained = false;
+    };
+
+    modesetting = {
+      enable = true;
+    };
+
+    nvidiaSettings = true;
+    #package = config.boot.kernelPackages.nvidiaPackages.stable;
+  };
+  
+  hardware.graphics.enable = true;
+
+  environment.systemPackages = with pkgs; [
+    cudaPackages.cudatoolkit
+  ];
+}

+ 15 - 0
nixos/hardware/sound/default.nix

@@ -0,0 +1,15 @@
+{ config, pkgs, ... }:
+{
+  environment.systemPackages = with pkgs; [
+    alsa-utils
+    pavucontrol
+  ];
+
+  security.rtkit.enable = true;
+  services.pipewire = {
+    enable = true;
+    alsa.enable = true;
+    alsa.support32Bit = true;
+    pulse.enable = true;
+  };
+}

+ 10 - 0
nixos/hardware/wifi/bcm4360.nix

@@ -0,0 +1,10 @@
+{ config, lib, pkgs, ... }:
+{
+  boot.blacklistedKernelModules = [ "b43" "bcma" "brcmfmac" ];
+  boot.extraModulePackages = with config.boot.kernelPackages; [ broadcom_sta ];
+
+  nixpkgs.config.allowInsecurePredicate = pkg:
+    builtins.elem (lib.getName pkg) [
+      "broadcom-sta"
+    ];
+}