diff options
| -rw-r--r-- | flake.lock | 193 | ||||
| -rw-r--r-- | flake.nix | 81 | ||||
| -rw-r--r-- | hardware-configuration.nix | 51 | ||||
| -rw-r--r-- | home-manager/home.nix | 119 | ||||
| -rw-r--r-- | machines/zenbook/configuration.nix | 87 | ||||
| -rw-r--r-- | modules/bluetooth.nix | 12 | ||||
| -rw-r--r-- | modules/environment.nix | 15 | ||||
| -rw-r--r-- | modules/hyprland.nix | 5 | ||||
| -rw-r--r-- | modules/kde-connect.nix | 7 | ||||
| -rw-r--r-- | modules/nix-common.nix | 24 | ||||
| -rw-r--r-- | modules/services.nix | 50 | ||||
| -rw-r--r-- | modules/sway.nix | 40 | ||||
| -rw-r--r-- | modules/user-profiles/defin.nix | 25 | ||||
| -rw-r--r-- | modules/user-profiles/root.nix | 20 | ||||
| -rw-r--r-- | system-packages.nix | 75 |
15 files changed, 804 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..259420a --- /dev/null +++ b/flake.lock @@ -0,0 +1,193 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1693208669, + "narHash": "sha256-hHFaaUsZ860wvppPeiu7nJn/nXZjJfnqAQEu9SPFE9I=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "5bac4a1c06cd77cf8fc35a658ccb035a6c50cd2c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.05", + "repo": "home-manager", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs", + "systems": "systems", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1693395737, + "narHash": "sha256-5A/kappjfRyM/pvbhDzhlaBOJhrrZbYaMWkQD11yk4c=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "28a90d6055f7b616c611c839967765f6536a7cd9", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1693158576, + "narHash": "sha256-aRTTXkYvhXosGx535iAFUaoFboUrZSYb1Ooih/auGp0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a999c1cc0c9eb2095729d5aa03e0d8f7ed256780", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1693377291, + "narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e7f38be3775bab9659575f192ece011c033655f0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1693341273, + "narHash": "sha256-wrsPjsIx2767909MPGhSIOmkpGELM9eufqLQOPxmZQg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2ab91c8d65c00fd22a441c69bbf1bc9b420d5ea1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "hyprland": "hyprland", + "nixpkgs": "nixpkgs_2", + "nixpkgs-unstable": "nixpkgs-unstable" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1692976565, + "narHash": "sha256-eBKkG7tMxg92NskEn8dHRFY245JwjirWRoOZzW6DnUw=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "717ded9bb0191ea31bf4368be32e7a15fe1b8294", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "rev": "717ded9bb0191ea31bf4368be32e7a15fe1b8294", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1691841170, + "narHash": "sha256-RCTm1/MVWYPnReMgyp7tr2ogGYo/pvw38jZaFwemgPU=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "57a3a41ba6b358109e4fc25c6a4706b5f7d93c6b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..24b84a2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,81 @@ +{ + description = "NixOS configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager/release-23.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + hyprland.url = "github:hyprwm/Hyprland"; + }; + + # outputs = { self, nixpkgs }: { + outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, hyprland, ... }: let + + system = "x86_64-linux"; + + # defFlakeSystem = baseCfg: nixpkgs.lib.nixosSystem { + defFlakeSystem = nixpkgs.lib.nixosSystem { + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + pkgsUnstable = import nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; + modules = [({ ... }: { + imports = [ + # baseCfg + home-manager.nixosModules.home-manager + { + # home-manager.useGlobalPkgs = true; + home-manager.useUserpackages = true; + } + ]; + # Let 'nixos-version --json' know the Git revision of this flake. + system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + nix.registry.nixpkgs.flake = nixpkgs; + })]; + }; + in { + + nixosConfigurations = { + zenbook = defFlakeSystem { + inherit system; + modules = [ + ./machines/zenbook/configuration.nix + + ./hardware-configuation.nix + + # Default users + ./modules/user-profiles/defin.nix + + home-manager.nixosModules.home-manager { + # home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.defin = import ./home-manager/home.nix; + + # Optionally, use home-manager.extraSpecialArgs to pass + # arguments to home.nix + } + + hyprland.homeManagerModules.default + {wayland.windowManager.hyprland.enable = true;} + ./modules/hyprland.nix + + ./modules/bluetooth.nix + ./modules/environment.nix + ./modules/kde-connect.nix + ./modules/nix-common.nix + ./modules/services.nix + ./modules/sway.nix + + + ]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..531b45b --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,51 @@ +# 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" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1a4350a8-db20-4c82-b8f4-7443fa5883f7"; + fsType = "btrfs"; + }; + + boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/f8a557dc-4571-408b-9689-a3be8180e3b1"; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/5806712b-acd3-46ec-b90e-ac5542cb210e"; + fsType = "btrfs"; + }; + + boot.initrd.luks.devices."home".device = "/dev/disk/by-uuid/dacb456e-d8bb-4a6b-a600-5d908c958032"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9ADD-2B42"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/1e7bfc05-3e03-4e27-8b60-92817ff780d4"; } + ]; + + boot.initrd.luks.devices."swap".device = "/dev/disk/by-uuid/f5f09c37-fb5d-4857-94f2-cfadcda7c82c"; + + # 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.<interface>.useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..371e642 --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,119 @@ +{ config, pkgs, ... }: +let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"; + unstable = import <nixpkgs-unstable>{}; +in +{ + imports = [ + (import "${home-manager}/nixos") + ]; + + home-manager.users.defin= { + home = { + # Home Manager needs a bit of information about you and the paths it should + # manage. + username = "defin"; + homeDirectory = "/home/defin"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + stateVersion = "23.05"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + packages = with pkgs; [ + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + marble-marcher-ce + firefox + qutebrowser + neofetch + yakuake + pass + btop + mpv + # unstable.yt-dlp + yt-dlp + telegram-desktop + obsidian + zettlr + # texlive-combined-full + # nushell + starship + kitty + exa + zoxide + broot + procs + gnupg + spotify-tui + spotifyd + # mpris + #helix plugins + # vadimcn.vscode-lldb + # yaml-language-server + # typescript-language-server + # rust-analyzer + # solargraph + # clangd + # vscode-json-language-server + # lua-language-server + # marksman + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + + # You can also manage environment variables but you will have to manually + # source + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/defin/etc/profile.d/hm-session-vars.sh + # + # if you don't want to manage your shell through Home Manager. + sessionVariables = { + # EDITOR = "emacs"; + }; + }; + programs = { + + ssh.matchBlocks = { + serverAliveCountMax = 6; + serverAliveInterval = 30; + }; + + starship = { + enable = true; + settings = { + command_timeout = 1000; + }; + }; + # Let Home Manager install and manage itself. + # home-manager.enable = true; + }; + }; +} diff --git a/machines/zenbook/configuration.nix b/machines/zenbook/configuration.nix new file mode 100644 index 0000000..827b59e --- /dev/null +++ b/machines/zenbook/configuration.nix @@ -0,0 +1,87 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running `nixos-help`). + +{ config, ... }: + +{ + # imports = + # [ # Include the results of the hardware scan. + # ./hardware-configuration.nix + # ./services.nix + # ./system-packages.nix + # ./sway.nix + # ./home-manager/home.nix + # ./hyprland.nix + # ]; + + # Use the systemd-boot EFI boot loader. + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + networking = { + firewall = { + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # enable = false; + }; + hostName = "zenbook"; + # Pick only one of the below networking options. + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + }; + + # Set your time zone. + # time.timeZone = "US/Mountain"; + time.timeZone = "Europe/Stockholm"; + # time.timeZone = "UTC"; + + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkbOptions in tty. + # }; + + + # Enable sound. + sound.enable = true; + # hardware.pulseaudio.enable = true; + + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + programs = { + light.enable = true; + mtr.enable = true; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.05"; # Did you read the comment? + +} + diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix new file mode 100644 index 0000000..36e8f8f --- /dev/null +++ b/modules/bluetooth.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: { + + hardware.bluetooth = { + enable = true; + # config = " + # [General] + # Enable=Source,Sink,Media,Socket + # "; + }; + + services.blueman.enable = true; +} diff --git a/modules/environment.nix b/modules/environment.nix new file mode 100644 index 0000000..07bef00 --- /dev/null +++ b/modules/environment.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: { + environment = { + # include user channels in NIX_PATH + shellInit = ''export NIXPATH="/nix/var/nix/profiles/per-user/$USER/channels:nixos-config=/etc/nixos/machines/zenbook/configuration.nix"''; + # List packages installed in system profile. To search, run: + # $ nix search wget + variables = { + # PATH = "/home/defin/.local/share/gem/ruby/3.0.0/bin:"; + # PAGER = "sh -c 'col -bx | bat -f'"; + MANPAGER = "sh -c 'col -bx | bat -l man -p'"; + EDITOR = "hx"; + ZEIT_DB = "/home/defin/Documents/zeit"; + }; + }; +} diff --git a/modules/hyprland.nix b/modules/hyprland.nix new file mode 100644 index 0000000..d91811a --- /dev/null +++ b/modules/hyprland.nix @@ -0,0 +1,5 @@ +{ config, lib, ...}: +{ + # Optional, hint electron apps to use wayland: + environment.sessionVariables.NIXOS_OZONE_WL = "1"; +}
\ No newline at end of file diff --git a/modules/kde-connect.nix b/modules/kde-connect.nix new file mode 100644 index 0000000..3705c44 --- /dev/null +++ b/modules/kde-connect.nix @@ -0,0 +1,7 @@ +{ config, lib, ... }: { + networking.firewall = { + allowedTCPPortRanges = [ { from = 1714; to = 1764; } ]; + allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; + }; + programs.kdeconnect.enable = true; +} diff --git a/modules/nix-common.nix b/modules/nix-common.nix new file mode 100644 index 0000000..874e2d6 --- /dev/null +++ b/modules/nix-common.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: { + + nixpkgs = { + # texlive.combined.scheme-medium; + config.allowUnfree = true; + }; + + nix = { + settings = { + allowed-users = [ "@wheel" "@builders" "@video" ]; + experimental-features = [ "nix-command" "flakes" ]; + }; + + # Clean up old generations after 30 days + gc = { + # automatic = true; + # dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + # Users allowed to run nix + # allowedUsers = [ "root" ]; + }; +} diff --git a/modules/services.nix b/modules/services.nix new file mode 100644 index 0000000..336d132 --- /dev/null +++ b/modules/services.nix @@ -0,0 +1,50 @@ +{ config, pkgs, ... }: +{ + services = { + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + spotifyd.enable = true; + + #FOR: sway + dbus.enable = true; + + #FROM: configuration.nix + # localtimed.enable = true; + xserver = { + # Enable the X11 windowing system. + enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + libinput.enable = true; + + # Configure keymap in X11 + # layout = "us"; + # xkbOptions = "eurosign:e,caps:escape"; + + # Enable the Plasma 5 Desktop Environment. + desktopManager.plasma5.enable = true; + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; + }; + }; + + # Enable CUPS to print documents. + printing = { + enable = true; + drivers = with pkgs; [ epson-escpr gutenprint ]; + }; + avahi = { + enable = true; + nssmdns = true; + # for a WiFi printer + openFirewall = true; + }; + + # Enable the OpenSSH daemon. + # openssh.enable = true; + }; +} diff --git a/modules/sway.nix b/modules/sway.nix new file mode 100644 index 0000000..8d4d664 --- /dev/null +++ b/modules/sway.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: +{ + environment.systemPackages = with pkgs; [ + ]; + + # xdg-desktop-portal works by exposing a series of D-Bus interfaces + # known as portals under a well-known name + # (org.freedesktop.portal.Desktop) and object path + # (/org/freedesktop/portal/desktop). + # The portal interfaces include APIs for file access, opening URIs, + # printing and others. + xdg.portal = { + enable = true; + wlr.enable = true; + # gtk portal needed to make gtk apps happy + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + # enable sway window manager + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + + # kanshi systemd service + systemd.user.services.kanshi = { + description = "kanshi daemon"; + serviceConfig = { + Type = "simple"; + ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file''; + }; + }; + + security.pam.services.swaylock.text = '' + # PAM configuration file for the swaylock screen locker. By default, it includes + # the 'login' configuration file (see /etc/pam.d/login) + auth include login + ''; +} + diff --git a/modules/user-profiles/defin.nix b/modules/user-profiles/defin.nix new file mode 100644 index 0000000..e3f2a01 --- /dev/null +++ b/modules/user-profiles/defin.nix @@ -0,0 +1,25 @@ +{config, pkgs, lib, ... }: { + + # Define a user account. Don't forget to set a password with ‘passwd’. + users = { + + mutableUsers = false; + users.defin = { + isNormalUser = true; + description = "Devin Finlinson"; + extraGroups = [ "wheel" "builders" "video"]; # Enable ‘sudo’ for the user. + shell = pkgs.nushell; + hashedPassword = "$6$UljPNAdxZ22lP3Bc$8VaEAacZxtXM3Zji2IA7Jf5fXs9pFnAVQff1d8IbfFOKCvjibceyopOAjRXa8lXtpOSJgPW1OO1dzOspqhWnz0"; + + oppenssh.authorizedKeys.keyFiles = [ + (builtins.fetchurl { + url = "https://gitlab.com/dFinlinson.keys"; + sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + }) + ]; + }; + }; + + # Allow to run nix + nix.allowedUsers = [ "defin" ]; +}
\ No newline at end of file diff --git a/modules/user-profiles/root.nix b/modules/user-profiles/root.nix new file mode 100644 index 0000000..eb95fbd --- /dev/null +++ b/modules/user-profiles/root.nix @@ -0,0 +1,20 @@ +{ config, pkgs, lib, ... }: { + + # Define a user account. Don't forget to set a password with 'passwd'. + users = { + users.root = { + isNormaluser = true; + hashedPassword = "$6$UljPNAdxZ22lP3Bc$8VaEAacZxtXM3Zji2IA7Jf5fXs9pFnAVQff1d8IbfFOKCvjibceyopOAjRXa8lXtpOSJgPW1OO1dzOspqhWnz0"; + + oppenssh.authorizedKeys.keyFiles = [ + (builtins.fetchurl { + url = "https://gitlab.com/dFinlinson.keys"; + sha256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + }) + ]; + }; + }; + + # Allow to run nix + nix.allowedUsers = [ "root" ]; +} diff --git a/system-packages.nix b/system-packages.nix new file mode 100644 index 0000000..3641703 --- /dev/null +++ b/system-packages.nix @@ -0,0 +1,75 @@ +{ pkgs, ...}: +let + + # bash script to let dbus know about important env variables and + # propagate them to relevent services run at the end of sway config + # see + # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist + # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts + # some user services to make sure they have the correct environment variables + dbus-sway-environment = pkgs.writeTextFile { + name = "dbus-sway-environment"; + destination = "/bin/dbus-sway-environment"; + executable = true; + + text = '' + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + ''; + }; + + # currently, there is some friction between sway and gtk: + # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland + # the suggested way to set gtk settings is with gsettings + # for gsettings to work, we need to tell it where the schemas are + # using the XDG_DATA_DIR environment variable + # run at the end of sway config + configure-gtk = pkgs.writeTextFile { + name = "configure-gtk"; + destination = "/bin/configure-gtk"; + executable = true; + text = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in '' + export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS + gnome_schema=org.gnome.desktop.interface + gsettings set $gnome_schema gtk-theme 'Dracula' + ''; + }; + +in + +{ + environment.systemPackages = with pkgs; [ + #For root + nushell + bat + helix + wget + unzip + git + #For hyprland + waybar + #For sway + alacritty # gpu accelerated terminal + dbus-sway-environment + configure-gtk + wayland + waybar + xdg-utils # for opening default programs when clicking links + glib # gsettings + dracula-theme # gtk theme + gnome3.adwaita-icon-theme # default gnome cursors + swaylock + swayidle + grim # screenshot functionality + slurp # screenshot functionality + bemenu # wayland clone of dmenu + mako # notification system developed by swaywm maintainer + wdisplays # tool to configure displays + wofi + (writeShellScriptBin "rofi" "exec -a $0 ${wofi}/bin/wofi $@") #Lets qutebrowser select passwords + ]; +} |
