diff --git a/flake.lock b/flake.lock index cef77c0..9f4000c 100755 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1680876084, + "narHash": "sha256-eP9yxP0wc7XuVaODugh+ajgbFGaile2O1ihxiLxOuvU=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "3006d2860a6ed5e01b0c3e7ffb730e9b293116e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1681920287, @@ -39,6 +55,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 331c5e3..5b4d13d 100755 --- a/flake.nix +++ b/flake.nix @@ -3,22 +3,23 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, home-manager, ... }: + outputs = { self, nixpkgs, home-manager, nixos-hardware, ... }: let username = "e"; in { nixosConfigurations = ( import ./hosts { inherit (nixpkgs) lib; + inherit nixos-hardware; inherit nixpkgs home-manager username; } - ); }; } diff --git a/hosts/configuration.nix b/hosts/configuration.nix index 5a8c5ae..0bb7093 100755 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -2,14 +2,16 @@ { boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + networking.networkmanager.enable = true; time.timeZone = "America/Chicago"; users.users.${username} = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = [ + "wheel" + "plugdev" + "video" + ]; }; - environment.systemPackages = with pkgs; [ - curl - ]; - system.stateVersion = "22.11"; # Did you read the comment? + users.groups.plugdev = {}; + system.stateVersion = "22.11"; } diff --git a/hosts/default.nix b/hosts/default.nix index 5899e9e..e02981c 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,17 +1,17 @@ -{ lib, nixpkgs, username, home-manager, ... }: +{ lib, nixpkgs, username, home-manager, nixos-hardware, ... }: let - system = "x86_64-linux"; # System architecture + system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; - config.allowUnfree = true; # Allow proprietary software + config.allowUnfree = true; }; lib = nixpkgs.lib; in { - t14 = lib.nixosSystem { # Laptop profile + t14 = lib.nixosSystem { inherit system; specialArgs = { inherit username; @@ -22,6 +22,7 @@ in modules = [ ./configuration.nix ./t14/configuration.nix + nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; diff --git a/hosts/t14/configuration.nix b/hosts/t14/configuration.nix index 3cdc70a..56a823b 100755 --- a/hosts/t14/configuration.nix +++ b/hosts/t14/configuration.nix @@ -1,25 +1,25 @@ { config, pkgs, ... }: { imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ./nano.nix - ]; - networking.hostName = "t14"; # Define your hostname. - environment.systemPackages = with pkgs; [ - cryptsetup - ]; - fonts = { - fonts = with pkgs; [ - spleen + [ + ./hardware-configuration.nix + ./nano.nix ]; - }; - programs.light.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - }; - nixpkgs.config.allowUnfree = true; - system.stateVersion = "22.11"; # Did you read the comment? -} + networking.hostName = "t14"; + environment.systemPackages = with pkgs; [ + cryptsetup + ]; + fonts = { + fonts = with pkgs; [ + spleen + ]; + }; + programs.light.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + nixpkgs.config.allowUnfree = true; + system.stateVersion = "22.11"; + } diff --git a/modules/discord/default.nix b/modules/discord/default.nix deleted file mode 100644 index 00c3f2b..0000000 --- a/modules/discord/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = [ - discord - ]; -} diff --git a/modules/wayland/default.nix b/modules/wayland/default.nix index a7317d5..a9a0981 100644 --- a/modules/wayland/default.nix +++ b/modules/wayland/default.nix @@ -4,7 +4,7 @@ wl-clipboard autotiling-rs gammastep - grim + sway-contrib.grimshot ]; systemd.user.services.autotiling = { Install = { @@ -65,6 +65,17 @@ "${modifier}+space" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"; "${modifier}+bracketleft" = "exec --no-startup-id grimshot --notify save area /tmp/scrot-$(date \"+%Y-%m-%d\"T\"%H:%M:%S\").png"; "${modifier}+bracketright" = "exec --no-startup-id grimshot --notify copy area"; + "XF86MonBrightnessDown" = "exec light -U 10"; + "XF86MonBrightnessUp" = "exec light -A 10"; + "XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%'"; + "XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%'"; + "XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'"; + }; + assigns = { + "9" = [ + { class = "discord";} + { class = "Signal";} + ]; }; bars = [ {