Add hardware config and fix hummelberg build

This commit is contained in:
Fabian Hauser 2022-04-11 15:05:05 +02:00
parent 1452c2a43d
commit b2f0797b01
15 changed files with 68 additions and 52 deletions

View file

@ -1,12 +1,14 @@
{ config, lib, pkgs, ... }:
let users = {
let
users = {
fhauser = {
uid = 1000;
isNormalUser = true;
description = "Fabian Hauser";
group = "fhauser";
extraGroups = [ "wheel" "video" "docker" "networkmanager" "libvirtd" "adbusers" ];
extraGroups =
[ "wheel" "video" "docker" "networkmanager" "libvirtd" "adbusers" ];
hashedPassword =
"$6$rounds=20000$TYZ8CojfBLwejcwn$smEJe6/anL9NGf.Ytfny14nBfhr4TRPv2XK1lgHz7yg.zQow1HACePirEjsjxzFC6vTHGaT8t2NxobUsHbWLg1";
openssh.authorizedKeys.keys = [

View file

@ -1,11 +1,11 @@
{ config, lib, pkgs, modulesPath, ... }: {
{ config, lib, pkgs, modulesPath, hardwareModules, ... }: {
imports = [
imports = with hardwareModules; [
(modulesPath + "/installer/scan/not-detected.nix")
<nixos-hardware/lenovo/thinkpad/t14>
<nixos-hardware/common/cpu/intel>
<nixos-hardware/common/pc/ssd>
<nixos-hardware/common/pc/laptop>
lenovo-thinkpad-t14
common-cpu-intel
common-pc-ssd
common-pc-laptop
];
boot.initrd.availableKernelModules = [

View file

@ -1,10 +1,9 @@
{ config, lib, pkgs, modulesPath, ... }: {
{ config, lib, pkgs, nixos-hardware, modulesPath, ... }: {
imports = [
imports = with nixos-hardware.nixosModules;
[
(modulesPath + "/installer/scan/not-detected.nix")
<nixos-hardware/lenovo/thinkpad/t470s>
<nixos-hardware/common/pc/ssd>
<nixos-hardware/common/pc/laptop>
# TODO: Not relevant anymore anyway
];
boot.initrd.availableKernelModules =

24
flake.lock generated
View file

@ -41,6 +41,21 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1649660850,
"narHash": "sha256-x8ZE4B+EuA9dCEJKNzT59yQjzotVMnGYU5GMoqMLk3A=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "f4160a629bac3538939a3005c8b5c7fb320bcf59",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs-nixos-2111": {
"locked": {
"lastModified": 1647490331,
@ -91,11 +106,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1649408932,
"narHash": "sha256-JhTW1OtS5fACcRXLqcTTQyYO5vLkO+bceCqeRms13SY=",
"lastModified": 1649497218,
"narHash": "sha256-groqC9m1P4hpnL6jQvZ3C8NEtduhdkvwGT0+0LUrcYw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "42948b300670223ca8286aaf916bc381f66a5313",
"rev": "fd364d268852561223a5ada15caad669fd72800e",
"type": "github"
},
"original": {
@ -111,7 +126,7 @@
"nixpkgs-nixos-unstable": "nixpkgs-nixos-unstable"
},
"locked": {
"narHash": "sha256-MlaNIPEmdzbmd94VgUiWMAtha9RPx8MCo3ph/4/DONA=",
"narHash": "sha256-td+qvLGjYw0oRFYsMR4LKciDWyOoPGJJJ2phMFwN1ME=",
"path": "/etc/nixos/qois-infrastructure",
"type": "path"
},
@ -124,6 +139,7 @@
"inputs": {
"fabianhauser-etaxes-sg": "fabianhauser-etaxes-sg",
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"qois-infrastructure": "qois-infrastructure"

View file

@ -2,6 +2,7 @@
inputs = {
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-21.11";
nixos-hardware.url = "github:NixOS/nixos-hardware";
home-manager.url = "github:nix-community/home-manager/release-21.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs-stable";
qois-infrastructure.url = "path:/etc/nixos/qois-infrastructure";
@ -9,14 +10,17 @@
fabianhauser-etaxes-sg.inputs.nixpkgs.follows = "nixpkgs-stable";
};
outputs = { self, nixpkgs-unstable, nixpkgs-stable, home-manager, qois-infrastructure, fabianhauser-etaxes-sg, ... }@inputs:
let system = "x86_64-linux";
outputs = { self, nixpkgs-unstable, nixpkgs-stable, home-manager
, qois-infrastructure, fabianhauser-etaxes-sg, nixos-hardware, ... }@inputs:
let
system = "x86_64-linux";
pkgsUnstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true; # For vscode
};
in {
checks.${system}.formatCheck = let pkgs = pkgsUnstable; in pkgs.runCommand "nixfmt-check" { } ''
checks.${system}.formatCheck = let pkgs = pkgsUnstable;
in pkgs.runCommand "nixfmt-check" { } ''
set -euo pipefail
cd ${self}
${pkgs.findutils}/bin/find . -type f -name '*.nix' -exec ${pkgs.nixfmt}/bin/nixfmt --check {} +
@ -31,18 +35,26 @@
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit pkgsUnstable; pkgsEtaxesSg = fabianhauser-etaxes-sg.packages.${system}; };
extraSpecialArgs = {
inherit pkgsUnstable;
pkgsEtaxesSg = fabianhauser-etaxes-sg.packages.${system};
};
users.fhauser = import ./home/fhauser/default.nix;
};
};
mapHostnameToAttr = host:
nixpkgs-stable.lib.nixosSystem {
inherit system;
modules = [ qois-infrastructure.nixosModule home-manager.nixosModules.home-manager home-manager-config ./host/${host}/default.nix ];
specialArgs.hardwareModules = nixos-hardware.nixosModules;
modules = [
qois-infrastructure.nixosModule
home-manager.nixosModules.home-manager
home-manager-config
./host/${host}/default.nix
];
};
in pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr;
homeConfigurations = {
fhauser = home-manager.lib.homeManagerConfiguration rec {
inherit system;

View file

@ -34,7 +34,8 @@
};
home = {
packages = with pkgsEtaxesSg; with pkgs;
packages = with pkgsEtaxesSg;
with pkgs;
[ # Networking
unison
transmission # GUI Tools, maybe extract...

View file

@ -1,7 +1,6 @@
{ pkgs, pkgsUnstable, ... }: {
#TODO: ENV variabls for agent
home.sessionVariables.SSH_AUTH_SOCK =
"/run/user/1000/gnupg/S.gpg-agent.ssh";
home.sessionVariables.SSH_AUTH_SOCK = "/run/user/1000/gnupg/S.gpg-agent.ssh";
programs.gpg = {
enable = true;
package = pkgsUnstable.gnupg;

View file

@ -25,7 +25,7 @@ let
${pkgs.pass-wayland}/bin/pass show -c "$password" 2>/dev/null
'';
threema-vpn = pkgs.writeScriptBin "threema-vpn" ""; #''
threema-vpn = pkgs.writeScriptBin "threema-vpn" ""; # ''
# #!${pkgs.stdenv.shell}
# set -eo pipefail
@ -73,7 +73,4 @@ let
ed
${xhost}/bin/xhost
'';
in {
home.packages =
[ passbemenu threema-vpn threema-env wsudo ];
}
in { home.packages = [ passbemenu threema-vpn threema-env wsudo ]; }

View file

@ -1,4 +1,5 @@
{ pkgs, lib, config, ... }: let
{ pkgs, lib, config, ... }:
let
adhereTheSwayTarget = {
Install.WantedBy = lib.mkForce [ "sway-session.target" ];
Unit.PartOf = lib.mkForce [ "sway-session.target" ];

View file

@ -2,15 +2,8 @@
{
home.packages = with pkgs;
[
neverball
wesnoth
pingus
superTux
superTuxKart
extremetuxracer
zeroad
] ++ (with pkgs.gnome; [ # Selection of gnome games
[ neverball wesnoth pingus superTux superTuxKart extremetuxracer zeroad ]
++ (with pkgs.gnome; [ # Selection of gnome games
five-or-more
four-in-a-row
gnome-chess

View file

@ -6,14 +6,10 @@
#./printing.nix
#./backup.nix #TODO: Extract applications from desktop role
../../hardware/thinkpad-p14s.nix
../../defaults/base
../../defaults/cifs-auth-fix
../../defaults/desktop
#../../defaults/games
../../defaults/user-configuration
../../defaults/user-configuration/fhauser
../../defaults/hardware/thinkpad-p14s.nix
#../../defaults/printing
];

View file

@ -6,12 +6,11 @@
#./printing.nix
#./backup.nix #TODO: Extract applications from desktop role
../../hardware/amd-board.nix
../../hardware/ecc-memory.nix
../../defaults/base
../../defaults/cifs-auth-fix
../../defaults/desktop
../../defaults/hardware/amd-board.nix
../../defaults/hardware/ecc-memory.nix
#../../defaults/printing
];

View file

@ -1,3 +1,4 @@
self: super: {
self: super:
{
}