From 079b6f0acc36524b61546117770154cc983a0a7f Mon Sep 17 00:00:00 2001 From: John Locke Date: Sun, 10 Mar 2024 00:20:39 -0800 Subject: [PATCH] Add desktop --- desktop/common.nix | 29 +++++++++++++++++++ desktop/default.nix | 70 +++++++++++++++++++++++++++++++++++++++++++++ desktop/dev.nix | 24 ++++++++++++++++ desktop/office.nix | 10 +++++++ 4 files changed, 133 insertions(+) create mode 100644 desktop/common.nix diff --git a/desktop/common.nix b/desktop/common.nix new file mode 100644 index 0000000..8bdb5ce --- /dev/null +++ b/desktop/common.nix @@ -0,0 +1,29 @@ +{pkgs, ...}: { + + environment.systemPackages = with pkgs; [ + home-manager + vim + firefox + bat + byobu + curl + git + fd + flameshot + fishPlugins.done + fishPlugins.fzf-fish + fishPlugins.forgit + fzf + google-chrome + lua + microsoft-edge + ripgrep + starship + terminator + thunderbird + tmux + vlc + wget + zoom-us + ]; +} diff --git a/desktop/default.nix b/desktop/default.nix index e69de29..606681f 100644 --- a/desktop/default.nix +++ b/desktop/default.nix @@ -0,0 +1,70 @@ + +{ + pkgs, + ... +} @ args: { + + imports = [ + ./common.nix + ]; + + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + + # AppImage support + boot.binfmt.registrations.appimage = { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; + magicOrExtension = ''\x7fELF....AI\x02''; + }; + + # Set your time zone. + time.timeZone = "America/Los_Angeles"; + + + # Enable CUPS to print documents. + services.printing.enable = true; + + services.salt.minion.enable = true; + services.salt.minion.configuration = { + master = "salt.freelock.lan"; + location = [ "freelock" ]; + }; + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.john = { + isNormalUser = true; + description = "John"; + extraGroups = [ "networkmanager" "wheel" "docker" ]; + shell = pkgs.fish; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + nixpkgs.config.permittedInsecurePackages = [ + "electron-25.9.0" + ]; + +} diff --git a/desktop/dev.nix b/desktop/dev.nix index e69de29..5553afd 100644 --- a/desktop/dev.nix +++ b/desktop/dev.nix @@ -0,0 +1,24 @@ +{pkgs, ...}: { + + environment.systemPackages = with pkgs; [ + ddev + mkcert + php81 + polypane + vault + ]; + + + # DDev setup + # Install & enable docker. + virtualisation.docker.enable = true; + + # Allow Xdebug to use port 9003. + networking.firewall.allowedTCPPorts = [ 9000 9003 ]; + + # Make it possible for ddev to modify the /etc/hosts file. + # Otherwise you'll have to manually change the + # hosts configuration after creating a new ddev project. + environment.etc.hosts.mode = "0644"; + +} diff --git a/desktop/office.nix b/desktop/office.nix index e69de29..bb10efc 100644 --- a/desktop/office.nix +++ b/desktop/office.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + + environment.systemPackages = with pkgs; [ + gimp-with-plugins + libreoffice-qt + nextcloud-client + obs-studio + obsidian + ]; +}