Compare commits

...

5 commits

Author SHA1 Message Date
08cb02d7d9
add new host bemmer 2021-10-23 00:26:56 +02:00
c576495bb2
update deploy script to support aarch64 2021-10-23 00:26:39 +02:00
e2efc79686
add nixos-hardware repo 2021-10-23 00:26:04 +02:00
dda25e506c
switch to nixos-unstable 2021-10-23 00:25:51 +02:00
ab24240216
move stuff to shared-services 2021-10-23 00:25:25 +02:00
12 changed files with 78 additions and 17 deletions

View file

@ -11,12 +11,16 @@ then
fi
mode="${1:-switch}"
host="nuc"
target="nuc@nuc.c3h"
#host="${2:-nuc}"
#target="${3:-$host.c3h}"
host="${2:-nuc}"
target="${3:-$host.c3h}"
echo "deploying $host to $target"
sleep 1
sources=$(nix-build nix/sources-dir.nix --no-out-link)
set -x
nixos-rebuild "$mode" --target-host "$target" --use-remote-sudo -I $sources -I "nixos-config=$PWD/hosts/$host/configuration.nix"
system_drv=$(nix-instantiate "<nixpkgs/nixos>" -I $sources -I "nixos-config=$PWD/hosts/$host/configuration.nix" | head -n1)
nix-copy-closure --to $target $system_drv
system=$(ssh $target "nix-store --realise $system_drv")
ssh $target "sudo nix-env -p /nix/var/nix/profiles/system -i $system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration $mode"

View file

@ -0,0 +1,43 @@
{ modulesPath, lib, pkgs, ... }:
{
imports = [
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
<nixos-hardware/raspberry-pi/4>
../../common
# services
../../shared-services/pulseaudio.nix
#../../shared-services/nfs-server.nix
../../shared-services/mpd.nix
../../shared-services/ympd.nix
../../shared-services/spotifyd.nix
../../shared-services/desktop.nix
../../shared-services/vnc.nix
../../shared-services/webserver.nix
];
users.users.c3h = {
isNormalUser = true;
password = "c3h";
extraGroups = [ "wheel" ];
packages = with pkgs; [ chromium firefox mpv youtube-dl ];
};
networking.hostName = "bemmer";
networking.domain = "c3h";
networking.useDHCP = true;
nixpkgs.system = "aarch64-linux";
boot.initrd.availableKernelModules = lib.mkForce [ "vc4" "i2c_bcm2835" ];
boot.supportedFilesystems = lib.mkForce [ "ext4" "vfat" ];
boot.kernelPackages = pkgs.linuxPackages_rpi4;
documentation.enable = false;
hardware.raspberry-pi."4" = {
fkms-3d.enable = true;
#audio.enable = true;
};
system.stateVersion = "21.05";
}

View file

@ -3,17 +3,18 @@
{
imports = [
./hardware-configuration.nix
<nixos-hardware/common/cpu/intel>
../../common
# services
./pulseaudio.nix
./nfs-server.nix
./mpd.nix
./ympd.nix
./spotifyd.nix
./desktop.nix
./vnc.nix
./webserver.nix
../../shared-services/pulseaudio.nix
../../shared-services/nfs-server.nix
../../shared-services/mpd.nix
../../shared-services/ympd.nix
../../shared-services/spotifyd.nix
../../shared-services/desktop.nix
../../shared-services/vnc.nix
../../shared-services/webserver.nix
];
networking.hostName = "nuc";

View file

@ -11,16 +11,28 @@
"url": "https://github.com/nmattia/niv/archive/e0ca65c81a2d7a4d82a189f1e23a48d59ad42070.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixos-hardware": {
"branch": "master",
"description": "A collection of NixOS modules covering hardware quirks.",
"homepage": "",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "3aabf78bfcae62f5f99474f2ebbbe418f1c6e54f",
"sha256": "10g240brgjz7qi20adwajxwqrqb5zxc79ii1mc20fasgqlf2a8sx",
"type": "tarball",
"url": "https://github.com/NixOS/nixos-hardware/archive/3aabf78bfcae62f5f99474f2ebbbe418f1c6e54f.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "nixos-21.05",
"branch": "nixos-unstable",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "70904d4a9927a4d6e05c72c4aaac4370e05107f3",
"sha256": "08vvir0npyrdx85ypiannwzvyryqdw3749bghffhdsq2dgz1cx8z",
"rev": "34ad3ffe08adfca17fcb4e4a47bb5f3b113687be",
"sha256": "02li241rz5668nfyp88zfjilxf0mr9yansa93fbl38hjwkhf3ix6",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/70904d4a9927a4d6e05c72c4aaac4370e05107f3.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/34ad3ffe08adfca17fcb4e4a47bb5f3b113687be.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

View file

@ -8,4 +8,5 @@
hardware.pulseaudio.package = pkgs.pulseaudio;
hardware.pulseaudio.tcp.enable = true;
hardware.pulseaudio.tcp.anonymousClients.allowedIpRanges = [ "127.0.0.0/8" "::/64" "10.23.42.0/24" ];
environment.variables.PULSE_SERVER = "127.0.0.1";
}