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 let
user = "polen"; user = "polen";
password = "guest"; password = "password";
SSID = "Cogeco-F710";
SSIDpassword = "mypassword";
interface = "wlan0";
hostname = "pi"; hostname = "pi";
in { 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 = { boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi3; kernelPackages = pkgs.linuxKernel.packages.linux_rpi3;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
@ -34,24 +23,30 @@ in {
}; };
networking = { networking = {
networkmanager.enable = true;
wireless.enable = false;
hostName = hostname; 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; services.openssh.enable = true;
virtualisation.docker.enable = true;
users = { users = {
mutableUsers = false; mutableUsers = false;
users."${user}" = { users."${user}" = {
isNormalUser = true; isNormalUser = true;
password = password; password = password;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" "docker" ];
}; };
}; };

View file

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

60
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1718530797, "lastModified": 1729880355,
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "rev": "18536bf04cd71abd345f9579158841376fdd0c5a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -16,9 +16,61 @@
"type": "github" "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": { "root": {
"inputs": { "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,27 +3,36 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.sops-nix.url = "github:Mic92/sops-nix";
}; };
outputs = { nixpkgs, ... }@inputs: outputs = {nixpkgs, ...} @ inputs: {
{ nixosConfigurations = {
nixosConfigurations = { default = nixpkgs.lib.nixosSystem {
default = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;};
specialArgs = {inherit inputs;}; system = "x86_64-linux";
system = "x86_64-linux"; modules = [
modules = [ ./devices/xps13/configuration.nix
./devices/xps13/configuration.nix ./modules
./modules ];
]; };
}; pi = nixpkgs.lib.nixosSystem {
# pi = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;};
# specialArgs = {inherit inputs;}; system = "aarch64-linux";
# system = "aarch64-linux"; modules = [
# modules = [ "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
# ./devices/pi/configuration.nix ./devices/pi/configuration.nix
# ]; {
# }; sdImage.compressImage = false;
}; nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
}
];
};
}; };
};
} }