add hardware config

This commit is contained in:
iofq 2023-04-25 05:38:43 -05:00
parent 1a5d89af7a
commit 7cc67eda0f
7 changed files with 66 additions and 40 deletions

17
flake.lock generated
View file

@ -20,6 +20,22 @@
"type": "github" "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1681920287, "lastModified": 1681920287,
@ -39,6 +55,7 @@
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -3,22 +3,23 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, home-manager, ... }: outputs = { self, nixpkgs, home-manager, nixos-hardware, ... }:
let let
username = "e"; username = "e";
in { in {
nixosConfigurations = ( nixosConfigurations = (
import ./hosts { import ./hosts {
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
inherit nixos-hardware;
inherit nixpkgs home-manager username; inherit nixpkgs home-manager username;
} }
); );
}; };
} }

View file

@ -2,14 +2,16 @@
{ {
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = 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"; time.timeZone = "America/Chicago";
users.users.${username} = { users.users.${username} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user. extraGroups = [
}; "wheel"
environment.systemPackages = with pkgs; [ "plugdev"
curl "video"
]; ];
system.stateVersion = "22.11"; # Did you read the comment? };
users.groups.plugdev = {};
system.stateVersion = "22.11";
} }

View file

@ -1,17 +1,17 @@
{ lib, nixpkgs, username, home-manager, ... }: { lib, nixpkgs, username, home-manager, nixos-hardware, ... }:
let let
system = "x86_64-linux"; # System architecture system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; # Allow proprietary software config.allowUnfree = true;
}; };
lib = nixpkgs.lib; lib = nixpkgs.lib;
in in
{ {
t14 = lib.nixosSystem { # Laptop profile t14 = lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = {
inherit username; inherit username;
@ -22,6 +22,7 @@ in
modules = [ modules = [
./configuration.nix ./configuration.nix
./t14/configuration.nix ./t14/configuration.nix
nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;

View file

@ -1,11 +1,11 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = imports =
[ # Include the results of the hardware scan. [
./hardware-configuration.nix ./hardware-configuration.nix
./nano.nix ./nano.nix
]; ];
networking.hostName = "t14"; # Define your hostname. networking.hostName = "t14";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
cryptsetup cryptsetup
]; ];
@ -21,5 +21,5 @@
pulse.enable = true; pulse.enable = true;
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
system.stateVersion = "22.11"; # Did you read the comment? system.stateVersion = "22.11";
} }

View file

@ -1,6 +0,0 @@
{ pkgs, ... }:
{
home.packages = [
discord
];
}

View file

@ -4,7 +4,7 @@
wl-clipboard wl-clipboard
autotiling-rs autotiling-rs
gammastep gammastep
grim sway-contrib.grimshot
]; ];
systemd.user.services.autotiling = { systemd.user.services.autotiling = {
Install = { Install = {
@ -65,6 +65,17 @@
"${modifier}+space" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"; "${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}+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"; "${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 = [ bars = [
{ {