add (geekiot fully): add geekiot full (without old hm stuff) configuration
This commit is contained in:
parent
507e85e6a7
commit
3cf719b609
8 changed files with 137 additions and 10 deletions
|
|
@ -1,9 +1,15 @@
|
||||||
{ customFunctions, ... }:
|
|
||||||
{
|
{
|
||||||
imports = customFunctions.scan {
|
inputs,
|
||||||
|
customFunctions,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
customFunctions.scan {
|
||||||
path = ./.;
|
path = ./.;
|
||||||
exclude = [ ./default.nix ];
|
exclude = [ ./default.nix ];
|
||||||
};
|
}
|
||||||
|
++ [ inputs.nixos-hardware.nixosModules.common-cpu-intel ];
|
||||||
|
|
||||||
device.laptop = {
|
device.laptop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
41
devices/thinkbook/hardware-configuration.nix
Normal file
41
devices/thinkbook/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/622c5b1c-cfd5-4842-b3bc-cd41e83b7705";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.luks.devices."luks-49809cac-4c02-4ade-ae03-5a5ae88862db".device = "/dev/disk/by-uuid/49809cac-4c02-4ade-ae03-5a5ae88862db";
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/075D-5E04";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
28
flake.nix
28
flake.nix
|
|
@ -18,6 +18,18 @@
|
||||||
|
|
||||||
# Source: https://github.com/Mic92/sops-nix
|
# Source: https://github.com/Mic92/sops-nix
|
||||||
sops-nix.url = "github:mic92/sops-nix";
|
sops-nix.url = "github:mic92/sops-nix";
|
||||||
|
|
||||||
|
# Source: https://github.com/nix-community/nix-vscode-extensions
|
||||||
|
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
|
||||||
|
|
||||||
|
# Source: https://github.com/catppuccin/nix
|
||||||
|
catppuccin.url = "github:catppuccin/nix";
|
||||||
|
|
||||||
|
# Source: https://github.com/helix-editor/helix
|
||||||
|
helix.url = "github:helix-editor/helix";
|
||||||
|
|
||||||
|
# Source: https://github.com/zedless-editor/zedless
|
||||||
|
zedless-editor.url = "github:zedless-editor/zedless";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
@ -28,9 +40,21 @@
|
||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
#
|
makeConfig = import ./lib/config.nix {
|
||||||
|
inherit
|
||||||
|
inputs
|
||||||
|
nixpkgs
|
||||||
|
nixpkgs-old
|
||||||
|
nixpkgs-latest
|
||||||
|
;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
#
|
nixosConfigurations.book = makeConfig "thinkbook" {
|
||||||
|
hostName = "book";
|
||||||
|
userName = "geekiot";
|
||||||
|
additionalOverlays = [ inputs.nix-vscode-extensions.overlays.default ];
|
||||||
|
systemArch = "x86_64-linux";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,14 @@ in
|
||||||
paths = {
|
paths = {
|
||||||
inherit homeDir;
|
inherit homeDir;
|
||||||
configDir = "${homeDir}/NewProjects/nixos-config";
|
configDir = "${homeDir}/NewProjects/nixos-config";
|
||||||
|
downloadsDir = "${homeDir}/Downloads";
|
||||||
|
|
||||||
|
sshDir = "${homeDir}/.ssh";
|
||||||
|
gpgDir = "${homeDir}/.security/gpg";
|
||||||
sopsKeyFile = "${homeDir}/.security/sops/age/keys.txt";
|
sopsKeyFile = "${homeDir}/.security/sops/age/keys.txt";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
device = {
|
||||||
|
inherit deviceName hostName systemArch;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +1,19 @@
|
||||||
{ userData, customFunctions, ... }:
|
{ userData, customFunctions, ... }:
|
||||||
|
let
|
||||||
|
username = userData.info.userName;
|
||||||
|
homeDirectory = userData.paths.homeDir;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = customFunctions.scan {
|
imports = customFunctions.scan {
|
||||||
path = ./.;
|
path = ./.;
|
||||||
exclude = [ ./default.nix ];
|
exclude = [
|
||||||
|
./default.nix
|
||||||
|
./web/librewolf/extensions/addons.nix
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
username = userData.info.userName;
|
inherit username homeDirectory;
|
||||||
homeDirectory = userData.paths.homeDir;
|
|
||||||
stateVersion = "25.05";
|
stateVersion = "25.05";
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
CONFIG = userData.paths.configDir;
|
CONFIG = userData.paths.configDir;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
{
|
||||||
|
}
|
||||||
41
users/geekiot/scripts/default.nix
Normal file
41
users/geekiot/scripts/default.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
pkgs: {
|
||||||
|
updateSystem =
|
||||||
|
configPath: secretsPath:
|
||||||
|
pkgs.writeShellScriptBin "updateSystem" ''
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export my_wd=$PWD
|
||||||
|
cd ${configPath}
|
||||||
|
|
||||||
|
if [ ! -d "${secretsPath}" ]; then
|
||||||
|
echo "!!! Error !!! NixConfigSecrets directory not found in ${configPath}"
|
||||||
|
cd $my_wd
|
||||||
|
unset my_wd
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$(find NixConfigSecrets -maxdepth 1 -name '*.yaml' -print -quit)" ]; then
|
||||||
|
echo "!!! Error !!! No .yaml files found in NixConfigSecrets directory"
|
||||||
|
cd $my_wd
|
||||||
|
unset my_wd
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir secrets
|
||||||
|
cp -r NixConfigSecrets/*.yaml secrets/
|
||||||
|
git add secrets/*.yaml
|
||||||
|
|
||||||
|
if sudo nixos-rebuild switch --flake . "$@"; then
|
||||||
|
echo "Success: System successfully updated with new configuration"
|
||||||
|
else
|
||||||
|
echo "!!! Failure !!! Failed to apply NixOS configuration"
|
||||||
|
echo "System version remains unchanged"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git reset secrets/*.yaml
|
||||||
|
rm secrets/*.yaml
|
||||||
|
rm -d secrets
|
||||||
|
cd $my_wd
|
||||||
|
unset my_wd
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in a new issue