clean up and refactor more into OS snippets; bluetooth works on x13s
This commit is contained in:
parent
5921ad1df0
commit
ffdf25c117
27 changed files with 367 additions and 461 deletions
|
@ -1,5 +1,11 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
../../snippets/home-manager-with-zsh.nix
|
||||
../../snippets/nix-settings-holo-chain.nix
|
||||
../../snippets/radicale.nix
|
||||
../../snippets/sway-desktop.nix
|
||||
../../snippets/timezone.nix
|
||||
|
||||
../../profiles/common/configuration.nix
|
||||
../../profiles/graphical/configuration.nix
|
||||
../../modules/opinionatedDisk.nix
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
{
|
||||
nodeName,
|
||||
repoFlake,
|
||||
repoFlakeWithSystem,
|
||||
nodeFlake,
|
||||
}: let
|
||||
{ nodeName
|
||||
, repoFlake
|
||||
, repoFlakeWithSystem
|
||||
, nodeFlake
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
in {
|
||||
in
|
||||
{
|
||||
meta.nodeSpecialArgs.${nodeName} = {
|
||||
inherit repoFlake nodeName nodeFlake;
|
||||
packages' = repoFlake.packages.${system};
|
||||
repoFlakeInputs' = repoFlakeWithSystem system ({inputs', ...}: inputs');
|
||||
repoFlakeInputs' = repoFlakeWithSystem system ({ inputs', ... }: inputs');
|
||||
};
|
||||
|
||||
meta.nodeNixpkgs.${nodeName} = import nodeFlake.inputs.nixpkgs.outPath {
|
||||
inherit system;
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
# FIXME: why are these not effective in for the configuration.nix below?
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
${nodeName} = {
|
||||
|
@ -28,8 +25,6 @@ in {
|
|||
|
||||
imports = [
|
||||
(repoFlake + "/nix/os/devices/${nodeName}/configuration.nix")
|
||||
|
||||
nodeFlake.inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -24,13 +24,6 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../snippets/nix-settings-holo-chain.nix
|
||||
../../snippets/radicale.nix
|
||||
../../snippets/sway-desktop.nix
|
||||
../../snippets/timezone.nix
|
||||
];
|
||||
|
||||
nix.settings = {
|
||||
substituters = [
|
||||
];
|
||||
|
|
|
@ -11,96 +11,12 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
repoFlake.inputs.sops-nix.nixosModules.sops
|
||||
nodeFlake.inputs.disko.nixosModules.disko
|
||||
./disko.nix
|
||||
|
||||
../../profiles/common/user.nix
|
||||
../../profiles/common/pkg.nix
|
||||
|
||||
|
||||
{
|
||||
# nixpkgs.config.allowUnsupportedSystem = true;
|
||||
|
||||
# flake registry
|
||||
nix.registry.nixpkgs.flake = nodeFlake.inputs.nixpkgs;
|
||||
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${pkgs.path}"
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
nix.settings.max-jobs = lib.mkDefault "auto";
|
||||
}
|
||||
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
services.openssh.settings.PermitRootLogin = "yes";
|
||||
services.openssh.openFirewall = true;
|
||||
|
||||
users.commonUsers = {
|
||||
enable = true;
|
||||
enableNonRoot = true;
|
||||
installPassword = "install";
|
||||
};
|
||||
|
||||
sops.defaultSopsFile = ../../../../secrets/${nodeName}/secrets.yaml;
|
||||
sops.defaultSopsFormat = "yaml";
|
||||
}
|
||||
|
||||
nodeFlake.inputs.home-manager.nixosModules.home-manager
|
||||
|
||||
../../snippets/sway-desktop.nix
|
||||
../../snippets/radicale.nix
|
||||
];
|
||||
|
||||
hardware.thinkpad-x13s = {
|
||||
enable = true;
|
||||
|
||||
# TODO: use hardware address
|
||||
bluetoothMac = "65:9e:7a:8b:86:28";
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = nodeName;
|
||||
|
||||
firewall.enable = true;
|
||||
|
||||
# useNetworkd = true;
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.sshfs
|
||||
pkgs.util-linux
|
||||
pkgs.coreutils
|
||||
pkgs.vim
|
||||
|
||||
pkgs.git
|
||||
pkgs.git-crypt
|
||||
];
|
||||
|
||||
home-manager.users.steveej = _: {
|
||||
imports = [
|
||||
../../../home-manager/configuration/graphical-fullblown.nix
|
||||
|
||||
(_: {
|
||||
programs.chromium.extensions = [
|
||||
# can define host-specific extensions here
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
home.sessionVariables = { };
|
||||
|
||||
home.packages = with pkgs; [
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
83
nix/os/devices/steveej-x13s-rmvbl/flake.lock
generated
83
nix/os/devices/steveej-x13s-rmvbl/flake.lock
generated
|
@ -1,55 +1,5 @@
|
|||
{
|
||||
"nodes": {
|
||||
"adamcstephens_stop-export": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705876512,
|
||||
"narHash": "sha256-nvBqLyi8dMQf3xnROwEcUv4iqV55Mr8S8OGYepu14i4=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "388684db5b529bbd6f3e948cf175df089eb09766",
|
||||
"revCount": 14,
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/adamcstephens/stop-export.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/adamcstephens/stop-export.git"
|
||||
}
|
||||
},
|
||||
"alsa-ucm-conf": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705501566,
|
||||
"narHash": "sha256-Nyr7tjH5VBjocvaKaHCiK+zsjThYBtcr936aRWCBBpM=",
|
||||
"owner": "alsa-project",
|
||||
"repo": "alsa-ucm-conf",
|
||||
"rev": "e87dde51d68950537f92af955ad0633437cc419a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "alsa-project",
|
||||
"ref": "master",
|
||||
"repo": "alsa-ucm-conf",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"brainwart_x13s-nixos": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705565623,
|
||||
"narHash": "sha256-sisr/dFIz8p3/Y7mz+arWxjeiBmUTQkMqkF9j3c2dWE=",
|
||||
"owner": "BrainWart",
|
||||
"repo": "x13s-nixos",
|
||||
"rev": "29002122d86a1009ba70e7a4ca3063e5404c77a2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "BrainWart",
|
||||
"ref": "flake",
|
||||
"repo": "x13s-nixos",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -105,23 +55,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"linux_x13s": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705680516,
|
||||
"narHash": "sha256-NjCuPYjYHBJcoJR1ZaWQ9sRh0VpY2Y0hawkbUBRfCvk=",
|
||||
"owner": "jhovold",
|
||||
"repo": "linux",
|
||||
"rev": "bac95eabe6577faa2773cbe7e91c34fd17ab79a0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "jhovold",
|
||||
"ref": "wip/sc8280xp-v6.7",
|
||||
"repo": "linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mobile-nixos": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -140,11 +73,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1705774713,
|
||||
"narHash": "sha256-j6ADaDH9XiumUzkTPlFyCBcoWYhO83lfgiSqEJF2zcs=",
|
||||
"lastModified": 1705916986,
|
||||
"narHash": "sha256-iBpfltu6QvN4xMpen6jGGEb6jOqmmVQKUrXdOJ32u8w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1b64fc1287991a9cce717a01c1973ef86cb1af0b",
|
||||
"rev": "d7f206b723e42edb09d9d753020a84b3061a79d8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -172,11 +105,11 @@
|
|||
},
|
||||
"nixpkgs-unstable-small": {
|
||||
"locked": {
|
||||
"lastModified": 1705891108,
|
||||
"narHash": "sha256-PQ0Df5BzByg+0gPE1goa9WYVXSoEP6gtjblrbYC8WOI=",
|
||||
"lastModified": 1706022028,
|
||||
"narHash": "sha256-F8Gv4R4K/AvS3+6pWd8wlnw4Vhgf7bcszy7i8XPbzA0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8cccce637e19577815de54c5ecc3132dff965aee",
|
||||
"rev": "15ff1758e7816331033baa14eebbea68626128f3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -188,13 +121,9 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"adamcstephens_stop-export": "adamcstephens_stop-export",
|
||||
"alsa-ucm-conf": "alsa-ucm-conf",
|
||||
"brainwart_x13s-nixos": "brainwart_x13s-nixos",
|
||||
"disko": "disko",
|
||||
"get-flake": "get-flake",
|
||||
"home-manager": "home-manager",
|
||||
"linux_x13s": "linux_x13s",
|
||||
"mobile-nixos": "mobile-nixos",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-2211": "nixpkgs-2211",
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
buildPlatform = "x86_64-linux";
|
||||
nodeName = "steveej-x13s-rmvbl";
|
||||
|
||||
x13s-flake = get-flake ../steveej-x13s;
|
||||
|
||||
mkNixosConfiguration = { extraModules ? [ ], ... } @ attrs:
|
||||
nixpkgs.lib.nixosSystem (
|
||||
nixpkgs.lib.attrsets.recursiveUpdate
|
||||
|
@ -41,13 +43,15 @@
|
|||
inherit nodeName;
|
||||
|
||||
repoFlake = get-flake ../../../..;
|
||||
nodeFlake = self;
|
||||
|
||||
# TODO: double-check if this hack doesn't have negative side-effects
|
||||
# the reason for it is so that `nodeFlake.inputs.nixos-x13s.nixosModules.default` in the module is found
|
||||
nodeFlake = x13s-flake;
|
||||
}).meta.nodeSpecialArgs.${nodeName};
|
||||
|
||||
modules =
|
||||
[
|
||||
self.nixosModules.hardware-x13s
|
||||
|
||||
../steveej-x13s/configuration.nix
|
||||
./configuration.nix
|
||||
]
|
||||
++ extraModules;
|
||||
|
|
|
@ -10,31 +10,60 @@
|
|||
}:
|
||||
|
||||
{
|
||||
nixos-x13s = {
|
||||
enable = true;
|
||||
# TODO: use hardware address
|
||||
bluetoothMac = "65:9e:7a:8b:86:28";
|
||||
};
|
||||
|
||||
systemd.services.bluetooth-mac = {
|
||||
enable = true;
|
||||
path = [
|
||||
pkgs.systemd
|
||||
pkgs.util-linux
|
||||
pkgs.bluez5-experimental
|
||||
pkgs.expect
|
||||
];
|
||||
script = ''
|
||||
# TODO: this may not be required
|
||||
while ! (journalctl -b0 | grep 'Bluetooth: hci0: QCA setup on UART is completed'); do
|
||||
echo Waiting for bluetooth firmware to complete
|
||||
echo sleep 1
|
||||
done
|
||||
|
||||
(
|
||||
# best effort
|
||||
set +e
|
||||
rfkill block bluetooth
|
||||
echo $?
|
||||
btmgmt public-addr ${config.nixos-x13s.bluetoothMac}
|
||||
echo $?
|
||||
rfkill unblock bluetooth
|
||||
echo $?
|
||||
)
|
||||
'';
|
||||
requiredBy = [ "bluetooth.service" ];
|
||||
before = [ "bluetooth.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
|
||||
# we need a tty, otherwise btmgmt will hang
|
||||
StandardInput = "tty";
|
||||
TTYPath = "/dev/tty2";
|
||||
TTYReset = "yes";
|
||||
TTYVHangup = "yes";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
nodeFlake.inputs.nixos-x13s.nixosModules.default
|
||||
|
||||
repoFlake.inputs.sops-nix.nixosModules.sops
|
||||
nodeFlake.inputs.disko.nixosModules.disko
|
||||
./disko.nix
|
||||
|
||||
repoFlake.nixosModules.thinkpad-x13s
|
||||
|
||||
../../profiles/common/pkg.nix
|
||||
|
||||
{
|
||||
# flake registry
|
||||
nix.registry.nixpkgs.flake = nodeFlake.inputs.nixpkgs;
|
||||
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${pkgs.path}"
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
nix.settings.max-jobs = lib.mkDefault "auto";
|
||||
}
|
||||
|
||||
../../snippets/nix-settings.nix
|
||||
../../profiles/common/user.nix
|
||||
|
||||
{
|
||||
|
@ -42,30 +71,23 @@
|
|||
services.openssh.settings.PermitRootLogin = "yes";
|
||||
services.openssh.openFirewall = true;
|
||||
|
||||
# sops.defaultSopsFile = ../../../../secrets/${nodeName}/secrets.yaml;
|
||||
# sops.defaultSopsFormat = "yaml";
|
||||
sops.defaultSopsFile = ../../../../secrets/${nodeName}/secrets.yaml;
|
||||
sops.defaultSopsFormat = "yaml";
|
||||
|
||||
users.commonUsers = {
|
||||
enable = true;
|
||||
enableNonRoot = true;
|
||||
installPassword = "install";
|
||||
};
|
||||
}
|
||||
|
||||
nodeFlake.inputs.home-manager.nixosModules.home-manager
|
||||
|
||||
../../snippets/home-manager-with-zsh.nix
|
||||
../../snippets/sway-desktop.nix
|
||||
../../snippets/bluetooth.nix
|
||||
../../snippets/timezone.nix
|
||||
# ../../snippets/radicale.nix
|
||||
];
|
||||
|
||||
hardware.thinkpad-x13s = {
|
||||
enable = true;
|
||||
|
||||
# TODO: use hardware address
|
||||
bluetoothMac = "65:9e:7a:8b:86:28";
|
||||
};
|
||||
|
||||
networking.hostName = nodeName;
|
||||
networking.firewall.enable = true;
|
||||
networking.networkmanager.enable = true;
|
||||
|
@ -93,12 +115,23 @@
|
|||
../../../home-manager/configuration/graphical-fullblown.nix
|
||||
];
|
||||
|
||||
# seems to be broke on install
|
||||
programs.chromium.enable = lib.mkForce false;
|
||||
|
||||
home.sessionVariables = { };
|
||||
|
||||
home.packages = with pkgs; [
|
||||
];
|
||||
|
||||
# TODO: currently unsupported
|
||||
services.gammastep.enable = lib.mkForce false;
|
||||
# programs.chromium.enable = lib.mkForce false;
|
||||
};
|
||||
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"dtb=sc8280xp-lenovo-thinkpad-x13s.dtb"
|
||||
];
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = lib.mkForce false;
|
||||
loader.efi.efiSysMountPoint = "/boot";
|
||||
blacklistedKernelModules = [ "wwan" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
|
||||
imports = [
|
||||
(repoFlake + "/nix/os/devices/${nodeName}/configuration.nix")
|
||||
|
||||
nodeFlake.inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
networking.hostName = nodeName;
|
||||
|
|
141
nix/os/devices/steveej-x13s/flake.lock
generated
141
nix/os/devices/steveej-x13s/flake.lock
generated
|
@ -1,55 +1,5 @@
|
|||
{
|
||||
"nodes": {
|
||||
"adamcstephens_stop-export": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705876512,
|
||||
"narHash": "sha256-nvBqLyi8dMQf3xnROwEcUv4iqV55Mr8S8OGYepu14i4=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "388684db5b529bbd6f3e948cf175df089eb09766",
|
||||
"revCount": 14,
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/adamcstephens/stop-export.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/adamcstephens/stop-export.git"
|
||||
}
|
||||
},
|
||||
"alsa-ucm-conf": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705501566,
|
||||
"narHash": "sha256-Nyr7tjH5VBjocvaKaHCiK+zsjThYBtcr936aRWCBBpM=",
|
||||
"owner": "alsa-project",
|
||||
"repo": "alsa-ucm-conf",
|
||||
"rev": "e87dde51d68950537f92af955ad0633437cc419a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "alsa-project",
|
||||
"ref": "master",
|
||||
"repo": "alsa-ucm-conf",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"brainwart_x13s-nixos": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705565623,
|
||||
"narHash": "sha256-sisr/dFIz8p3/Y7mz+arWxjeiBmUTQkMqkF9j3c2dWE=",
|
||||
"owner": "BrainWart",
|
||||
"repo": "x13s-nixos",
|
||||
"rev": "29002122d86a1009ba70e7a4ca3063e5404c77a2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "BrainWart",
|
||||
"ref": "flake",
|
||||
"repo": "x13s-nixos",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -69,6 +19,24 @@
|
|||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1704982712,
|
||||
"narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "07f6395285469419cf9d078f59b5b49993198c00",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"get-flake": {
|
||||
"locked": {
|
||||
"lastModified": 1694475786,
|
||||
|
@ -105,23 +73,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"linux_x13s": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705680516,
|
||||
"narHash": "sha256-NjCuPYjYHBJcoJR1ZaWQ9sRh0VpY2Y0hawkbUBRfCvk=",
|
||||
"owner": "jhovold",
|
||||
"repo": "linux",
|
||||
"rev": "bac95eabe6577faa2773cbe7e91c34fd17ab79a0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "jhovold",
|
||||
"ref": "wip/sc8280xp-v6.7",
|
||||
"repo": "linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mobile-nixos": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -138,13 +89,34 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-x13s": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1705945811,
|
||||
"narHash": "sha256-eDqgRYGMzRfpfWvSVj6IhHAWOMJC3xiwKaClbe79Gro=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "9320defc4b8f381e5b7887d212d8d2babc41f2f2",
|
||||
"revCount": 2,
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/adamcstephens/nixos-x13s"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/adamcstephens/nixos-x13s"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1705774713,
|
||||
"narHash": "sha256-j6ADaDH9XiumUzkTPlFyCBcoWYhO83lfgiSqEJF2zcs=",
|
||||
"lastModified": 1705916986,
|
||||
"narHash": "sha256-iBpfltu6QvN4xMpen6jGGEb6jOqmmVQKUrXdOJ32u8w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1b64fc1287991a9cce717a01c1973ef86cb1af0b",
|
||||
"rev": "d7f206b723e42edb09d9d753020a84b3061a79d8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -170,13 +142,31 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1703961334,
|
||||
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable-small": {
|
||||
"locked": {
|
||||
"lastModified": 1705891108,
|
||||
"narHash": "sha256-PQ0Df5BzByg+0gPE1goa9WYVXSoEP6gtjblrbYC8WOI=",
|
||||
"lastModified": 1706022028,
|
||||
"narHash": "sha256-F8Gv4R4K/AvS3+6pWd8wlnw4Vhgf7bcszy7i8XPbzA0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8cccce637e19577815de54c5ecc3132dff965aee",
|
||||
"rev": "15ff1758e7816331033baa14eebbea68626128f3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -188,14 +178,11 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"adamcstephens_stop-export": "adamcstephens_stop-export",
|
||||
"alsa-ucm-conf": "alsa-ucm-conf",
|
||||
"brainwart_x13s-nixos": "brainwart_x13s-nixos",
|
||||
"disko": "disko",
|
||||
"get-flake": "get-flake",
|
||||
"home-manager": "home-manager",
|
||||
"linux_x13s": "linux_x13s",
|
||||
"mobile-nixos": "mobile-nixos",
|
||||
"nixos-x13s": "nixos-x13s",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-2211": "nixpkgs-2211",
|
||||
"nixpkgs-unstable-small": "nixpkgs-unstable-small"
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
url = "github:nix-community/home-manager/release-23.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixos-x13s.url = "git+https://codeberg.org/adamcstephens/nixos-x13s";
|
||||
nixos-x13s.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
@ -46,7 +49,8 @@
|
|||
|
||||
modules =
|
||||
[
|
||||
repoFlake.nixosModules.hardware-x13s
|
||||
# repoFlake.nixosModules.hardware-x13s
|
||||
|
||||
|
||||
./configuration.nix
|
||||
]
|
||||
|
|
|
@ -13,12 +13,6 @@ in
|
|||
type = lib.types.str;
|
||||
description = "mac address to set on boot";
|
||||
};
|
||||
|
||||
bluetoothMacAddr = lib.mkOption {
|
||||
default = "00:00:00:00:00";
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
};
|
||||
config =
|
||||
let
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
boot.kernelPackages = pkgs.linuxPackages;
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = false;
|
||||
};
|
||||
|
||||
boot.loader.systemd-boot.enable = false;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Workaround for nm-pptp to enforce module load
|
||||
boot.kernelModules = ["nf_conntrack_proto_gre" "nf_conntrack_pptp"];
|
||||
}
|
|
@ -1,18 +1,38 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
repoFlake,
|
||||
...
|
||||
{ config
|
||||
, pkgs
|
||||
, repoFlake
|
||||
, nodeFlake
|
||||
, repoFlakeInputs'
|
||||
, packages'
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
./boot.nix
|
||||
./pkg.nix
|
||||
./system.nix
|
||||
../../snippets/nix-settings.nix
|
||||
./hw.nix
|
||||
|
||||
./user.nix
|
||||
|
||||
repoFlake.inputs.sops-nix.nixosModules.sops
|
||||
|
||||
../../snippets/nix-settings.nix
|
||||
../../snippets/home-manager-with-zsh.nix
|
||||
|
||||
./system.nix
|
||||
./hw.nix
|
||||
./user.nix
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages;
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = false;
|
||||
};
|
||||
|
||||
boot.loader.systemd-boot.enable = false;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Workaround for nm-pptp to enforce module load
|
||||
boot.kernelModules = [ "nf_conntrack_proto_gre" "nf_conntrack_pptp" ];
|
||||
|
||||
nixpkgs.config = {
|
||||
allowBroken = false;
|
||||
allowUnfree = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
{ config
|
||||
, pkgs
|
||||
, # these come in via nodeSpecialArgs and are expected to be defined for every node
|
||||
repoFlake
|
||||
, repoFlakeInputs'
|
||||
, nodeFlake
|
||||
, packages'
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
];
|
||||
|
||||
nix.registry.nixpkgs.flake = nodeFlake.inputs.nixpkgs;
|
||||
home-manager.useGlobalPkgs = false;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.root = import ../../../home-manager/configuration/text-minimal.nix;
|
||||
|
||||
# TODO: investigate an issue with the "name" arg contained here, which causes problems with home-manager
|
||||
# home-manager.extraSpecialArgs = specialArgs;
|
||||
# hence, opt for passing the arguments selectively instead
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit
|
||||
repoFlake
|
||||
repoFlakeInputs'
|
||||
packages'
|
||||
nodeFlake
|
||||
;
|
||||
};
|
||||
|
||||
nixpkgs.config = {
|
||||
allowBroken = false;
|
||||
allowUnfree = true;
|
||||
};
|
||||
}
|
|
@ -42,15 +42,12 @@
|
|||
# mv -Tf /etc/X11/.sessions /etc/X11/sessions
|
||||
# '';
|
||||
|
||||
# TODO: adapt this to be arch agnostic
|
||||
system.activationScripts.lib64 = ''
|
||||
echo "setting up /lib64..."
|
||||
mkdir -p /lib64
|
||||
ln -sfT ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 /lib64/.ld-linux-x86-64.so.2
|
||||
mv -Tf /lib64/.ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
|
||||
'';
|
||||
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
programs.fuse.userAllowOther = true;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
{ pkgs
|
||||
, lib
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
../../snippets/bluetooth.nix
|
||||
];
|
||||
|
||||
networking.networkmanager = {
|
||||
enable = true;
|
||||
dns = "systemd-resolved";
|
||||
|
@ -22,12 +25,8 @@
|
|||
services.illum.enable = true;
|
||||
services.pcscd.enable = true;
|
||||
hardware.opengl.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
# required for running blueman-applet in user sessions
|
||||
services.dbus.packages = with pkgs; [blueman];
|
||||
services.blueman.enable = true;
|
||||
|
||||
services.udev.packages = [pkgs.libu2f-host pkgs.yubikey-personalization pkgs.android-udev-rules];
|
||||
services.udev.packages = [ pkgs.libu2f-host pkgs.yubikey-personalization pkgs.android-udev-rules ];
|
||||
services.udev.extraRules = ''
|
||||
# OnePlusOne
|
||||
ATTR{idVendor}=="05c6", ATTR{idProduct}=="6764", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
|
||||
|
@ -54,6 +53,6 @@
|
|||
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = with pkgs; [mfcl3770cdwlpr mfcl3770cdwcupswrapper];
|
||||
drivers = with pkgs; [ mfcl3770cdwlpr mfcl3770cdwcupswrapper ];
|
||||
};
|
||||
}
|
||||
|
|
9
nix/os/snippets/bluetooth.nix
Normal file
9
nix/os/snippets/bluetooth.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, ...
|
||||
}: {
|
||||
# required for running blueman-applet in user sessions
|
||||
services.dbus.packages = with pkgs; [ blueman ];
|
||||
hardware.bluetooth.enable = true;
|
||||
services.blueman.enable = true;
|
||||
}
|
49
nix/os/snippets/home-manager-with-zsh.nix
Normal file
49
nix/os/snippets/home-manager-with-zsh.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ nodeFlake
|
||||
, repoFlake
|
||||
, repoFlakeInputs'
|
||||
, packages'
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
# TODO: make this configurable
|
||||
homeUser = "steveej";
|
||||
commonHomeImports = [
|
||||
../../home-manager/profiles/common.nix
|
||||
../../home-manager/programs/neovim.nix
|
||||
../../home-manager/programs/zsh.nix
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
nodeFlake.inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
# TODO: investigate an issue with the "name" arg contained here, which causes problems with home-manager
|
||||
# home-manager.extraSpecialArgs = specialArgs;
|
||||
# hence, opt for passing the arguments selectively instead
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit
|
||||
repoFlake
|
||||
repoFlakeInputs'
|
||||
packages'
|
||||
nodeFlake
|
||||
;
|
||||
};
|
||||
|
||||
home-manager.useGlobalPkgs = false;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.users.root = _: {
|
||||
imports = commonHomeImports;
|
||||
};
|
||||
|
||||
home-manager.users."${homeUser}" = _: {
|
||||
imports = commonHomeImports;
|
||||
};
|
||||
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
}
|
|
@ -1,9 +1,7 @@
|
|||
{
|
||||
nodeFlake,
|
||||
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
{ nodeFlake
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}: {
|
||||
nix.daemonCPUSchedPolicy = "idle";
|
||||
nix.daemonIOSchedClass = "idle";
|
||||
|
@ -17,8 +15,6 @@
|
|||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
"ca-derivations"
|
||||
"impure-derivations"
|
||||
];
|
||||
|
||||
nix.settings.system-features = [
|
||||
|
@ -29,4 +25,5 @@
|
|||
];
|
||||
|
||||
nix.registry.nixpkgs.flake = nodeFlake.inputs.nixpkgs;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
# TODO: make this configurable
|
||||
|
@ -64,6 +68,7 @@ in
|
|||
};
|
||||
|
||||
security.pam.services.getty.enableGnomeKeyring = true;
|
||||
security.pam.services."autovt@tty1".enableGnomeKeyring = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
# autologin steveej on tty1
|
||||
|
@ -79,11 +84,20 @@ in
|
|||
Restart = "always";
|
||||
Type = "idle";
|
||||
};
|
||||
programs.zsh.loginShellInit = ''
|
||||
if test $(id --user steveej) = $(id -u) && test $(tty) = "/dev/tty1"; then
|
||||
exec sway
|
||||
fi
|
||||
'';
|
||||
|
||||
programs =
|
||||
let
|
||||
steveejSwayOnTty1 = ''
|
||||
if test $(id --user steveej) = $(id -u) && test $(tty) = "/dev/tty1"; then
|
||||
exec sway
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
bash.loginShellInit = steveejSwayOnTty1;
|
||||
# TODO: only do this when zsh is enabled. first naiv attempt lead infinite recursion
|
||||
zsh.loginShellInit = steveejSwayOnTty1;
|
||||
};
|
||||
|
||||
home-manager.users."${homeUser}" = _: {
|
||||
imports = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue