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"
}
},
"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"
}
}

View file

@ -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;
}
);
};
}

View file

@ -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.
};
environment.systemPackages = with pkgs; [
curl
extraGroups = [
"wheel"
"plugdev"
"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
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;

View file

@ -1,11 +1,11 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
[
./hardware-configuration.nix
./nano.nix
];
networking.hostName = "t14"; # Define your hostname.
networking.hostName = "t14";
environment.systemPackages = with pkgs; [
cryptsetup
];
@ -21,5 +21,5 @@
pulse.enable = 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
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 = [
{