From 739acea0a28b7f70c0e8386ce4ecc68fa7e48b16 Mon Sep 17 00:00:00 2001 From: atagen Date: Wed, 17 May 2023 21:02:01 +1000 Subject: [PATCH] first stage of laptop flake --- home/dots/hyprland/hyprland.conf | 2 + home/plank.nix | 17 +++++ system/adrift.nix | 118 +++++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 home/plank.nix create mode 100644 system/adrift.nix diff --git a/home/dots/hyprland/hyprland.conf b/home/dots/hyprland/hyprland.conf index f620a54..721ecd9 100644 --- a/home/dots/hyprland/hyprland.conf +++ b/home/dots/hyprland/hyprland.conf @@ -128,4 +128,6 @@ bind=,XF86AudioStop,exec,playerctl stop bind=,XF86AudioPlay,exec,playerctl play-pause bind=,XF86AudioPrev,exec,playerctl previous bind=,XF86AudioNext,exec,playerctl next +bind=,XF86MonBrightnessUp,exec,brightnessctl,s +10% +bind=,XF86MonBrightnessDown,exec,brightnessctl,s -10% diff --git a/home/plank.nix b/home/plank.nix new file mode 100644 index 0000000..a760720 --- /dev/null +++ b/home/plank.nix @@ -0,0 +1,17 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + imports = [ + ./home.nix + ]; + + home = { + username = "plank"; + homeDirectory = "/home/plank"; + }; +} diff --git a/system/adrift.nix b/system/adrift.nix new file mode 100644 index 0000000..4582467 --- /dev/null +++ b/system/adrift.nix @@ -0,0 +1,118 @@ +{ + inputs, + outputs, + config, + lib, + pkgs, + overlays, + modulesPath, + ... +}: { + nix.settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; + + imports = [ + ./configuration.nix + inputs.hyprland.nixosModules.default + ]; + + boot.kernelParams = [ + "mitigations=off" + "quiet" + "loglevel=3" + "systemd.show_status=auto" + "rd.udev.log_level=3" + "vt.global_cursor_default=0" + ]; + + boot.loader.systemd-boot.configurationLimit = 2; + boot.loader.efi.canTouchEfiVariables = true; + # boot.plymouth.enable = true; + + networking.useDHCP = lib.mkDefault true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + environment.sessionVariables = rec { + EDITOR = "hx"; + }; + + virtualisation = { + podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + }; + + programs.hyprland = { + enable = true; + xwayland = { + enable = true; + hidpi = false; + }; + nvidiaPatches = true; + }; + + services.xserver.videoDrivers = ["i915"]; + programs.xwayland.enable = true; + + systemd.services."com.system76.Scheduler" = { + wantedBy = ["multi-user.target"]; + description = "the system76 process scheduler"; + serviceConfig = { + Type = "dbus"; + ExecStart = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon''; + ExecReload = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon reload''; + BusName = "com.system76.Scheduler"; + }; + }; + + services.dbus.packages = [ + pkgs.system76-scheduler + ]; + + systemd.packages = [ + pkgs.system76-scheduler + ]; + + environment.etc = { + "system76-scheduler".source = "${pkgs.system76-scheduler}/etc/system76-scheduler"; + }; + + xdg.portal = { + enable = true; + wlr = { + enable = true; + # settings = { + # screencast = { + # output_name = "DP-1"; + # max_fps = 60; + # chooser_type = "simple"; + # chooser_nvidia = "${pkgs.slurp}/bin/slurp -f %o -or"; + # }; + # }; + }; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + ]; + }; + + environment.systemPackages = with pkgs; [ + ckb-next + openrgb + wl-clipboard + wl-clipboard-x11 + xclip + brightnessctl + ]; + + networking.hostName = "adrift"; # Define your hostname. + users.users.plank = { + isNormalUser = true; + extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. + }; + +}