pi config working

This commit is contained in:
Polen 2024-10-30 22:21:42 -04:00
parent 4994ba4f77
commit f0aab13dda
5 changed files with 105 additions and 46 deletions

2
Makefile Normal file
View file

@ -0,0 +1,2 @@
build-pi-image:
nix build .#nixosConfigurations.pi.config.system.build.sdImage --print-out-paths

View file

@ -2,20 +2,9 @@
let
user = "polen";
password = "guest";
SSID = "Cogeco-F710";
SSIDpassword = "mypassword";
interface = "wlan0";
password = "password";
hostname = "pi";
in {
# imports = [
# inputs.sops-nix.nixosModules.ops
# ];
# sops.defaultSopsFile = ../../secrets/secrets.yaml;
# sops.defaultSopsFormat = "yaml";
# sops.age.keyFile = "/home/polen/.config/sops/age/keys.txt";
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi3;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
@ -34,24 +23,30 @@ in {
};
networking = {
networkmanager.enable = true;
wireless.enable = false;
hostName = hostname;
wireless = {
enable = true;
networks."${SSID}".psk = SSIDpassword;
interfaces = [ interface ];
};
};
environment.systemPackages = with pkgs; [ nvim ];
environment.systemPackages = with pkgs; [
neovim
tmux
curl
wget
git
ranger
];
services.openssh.enable = true;
virtualisation.docker.enable = true;
users = {
mutableUsers = false;
users."${user}" = {
isNormalUser = true;
password = password;
extraGroups = [ "wheel" ];
extraGroups = [ "wheel" "docker" ];
};
};

View file

@ -15,8 +15,6 @@
};
services.blueman.enable = true;
virtualisation.waydroid.enable = true;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
@ -25,6 +23,9 @@
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
boot.binfmt.emulatedSystems = ["aarch64-linux"];
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
@ -58,7 +59,6 @@
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.zsh;
};
#users.defaultUserShell = pkgs.zsh
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
@ -75,6 +75,7 @@
home-manager
sops
# Desktop
waybar
mako
swww

60
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1718530797,
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=",
"lastModified": 1729880355,
"narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9",
"rev": "18536bf04cd71abd345f9579158841376fdd0c5a",
"type": "github"
},
"original": {
@ -16,9 +16,61 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1729973466,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1729951556,
"narHash": "sha256-bpb6r3GjzhNW8l+mWtRtLNg5PhJIae041sPyqcFNGb4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4e0eec54db79d4d0909f45a88037210ff8eaffee",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1729999681,
"narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
}
},

View file

@ -3,11 +3,9 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.sops-nix.url = "github:Mic92/sops-nix";
};
outputs = { nixpkgs, ... }@inputs:
{
outputs = {nixpkgs, ...} @ inputs: {
nixosConfigurations = {
default = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
@ -17,13 +15,24 @@
./modules
];
};
# pi = nixpkgs.lib.nixosSystem {
# specialArgs = {inherit inputs;};
# system = "aarch64-linux";
# modules = [
# ./devices/pi/configuration.nix
# ];
# };
pi = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
system = "aarch64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
./devices/pi/configuration.nix
{
sdImage.compressImage = false;
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
}
];
};
};
};
}