Compare commits

..

No commits in common. "06847c6f6fdbeb048b12df1d427842ad5d6a5417" and "0cb82a43fbe648402ce8e77a41867a696e30483e" have entirely different histories.

5 changed files with 9 additions and 69 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
result

View File

@ -1,6 +1,8 @@
{ hardware, stable, config, pkgs, lib, ... }: { stable, config, pkgs, lib, ... }:
let let
SSID = "mywifi";
SSIDpassword = "mypassword";
interface = "wlan0"; interface = "wlan0";
hostname = "nixpi"; hostname = "nixpi";
in { in {
@ -21,47 +23,6 @@ in {
LC_TIME = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8";
}; };
services.xserver = {
enable = true;
# displayManager.lightdm.enable = true;
# desktopManager.gnome.enable = true;
videoDrivers = [ "fbdev" ];
};
sound.enable = true;
hardware.pulseaudio.enable = true;
# Create gpio group
users.groups.gpio = {};
# Change permissions gpio devices
services.udev.extraRules = ''
SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio",MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", RUN+="${pkgs.bash}/bin/bash -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add",RUN+="${pkgs.bash}/bin/bash -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"
SUBSYSTEM=="spidev", KERNEL=="spidev0.0", GROUP="spi", MODE="0660"
'';
hardware = {
raspberry-pi."4" = {
# audio.enable = true;
apply-overlays-dtmerge.enable = true;
};
deviceTree = {
enable = true;
filter = "*rpi-4-*.dtb";
overlays = [
{
name = "spi";
dtboFile = ./spi0-0cs.dtbo;
}
];
};
};
users.groups.spi = {};
console.keyMap = "de"; console.keyMap = "de";
services.xserver = { services.xserver = {
@ -91,12 +52,13 @@ in {
hostName = hostname; hostName = hostname;
wireless = { wireless = {
enable = true; enable = true;
userControlled.enable = false; networks."${SSID}".psk = SSIDpassword;
networks = (import ./networks.nix);
interfaces = [ interface ]; interfaces = [ interface ];
}; };
}; };
environment.systemPackages = with pkgs; [ vim ];
services.openssh.enable = true; services.openssh.enable = true;
programs.xonsh.enable = true; programs.xonsh.enable = true;
@ -106,8 +68,7 @@ in {
shell = pkgs.xonsh; shell = pkgs.xonsh;
isNormalUser = true; isNormalUser = true;
hashedPassword = "$y$j9T$ODBtPwWjIx50Bjhctw9kW/$jhfsHaAyh8zOXBV7cCK9l2M0yWyE3VLiL0h55XXV5J2"; hashedPassword = "$y$j9T$ODBtPwWjIx50Bjhctw9kW/$jhfsHaAyh8zOXBV7cCK9l2M0yWyE3VLiL0h55XXV5J2";
extraGroups = [ "wheel" "gpio" "spi" "dialout" ]; extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = (import ./authorizedKeys.nix);
}; };
}; };
@ -124,9 +85,7 @@ in {
git-lfs git-lfs
lm_sensors lm_sensors
file file
(writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@")
raspberrypi-eeprom raspberrypi-eeprom
libraspberrypi
]; ];
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];

View File

@ -64,22 +64,6 @@
"type": "github" "type": "github"
} }
}, },
"nixos-hardware": {
"locked": {
"lastModified": 1706182238,
"narHash": "sha256-Ti7CerGydU7xyrP/ow85lHsOpf+XMx98kQnPoQCSi1g=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "f84eaffc35d1a655e84749228cde19922fcf55f1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1703013332, "lastModified": 1703013332,
@ -131,7 +115,6 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
} }

View File

@ -1,3 +1,4 @@
# /etc/nixos/flake.nix
{ {
description = "flake for a remote display on a raspi"; description = "flake for a remote display on a raspi";
@ -5,10 +6,9 @@
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
}; };
outputs = {nixpkgs, nixpkgs-stable, agenix, nixos-hardware, ...} @ inputs: let outputs = {nixpkgs, nixpkgs-stable, agenix, ...} @ inputs: let
system = "aarch64-linux"; system = "aarch64-linux";
stable = import nixpkgs-stable { inherit system; config.allowUnfree = true; }; stable = import nixpkgs-stable { inherit system; config.allowUnfree = true; };
in { in {
@ -17,7 +17,6 @@
specialArgs = { inherit inputs stable; }; specialArgs = { inherit inputs stable; };
modules = [ modules = [
./configuration.nix ./configuration.nix
nixos-hardware.nixosModules.raspberry-pi-4
agenix.nixosModules.default agenix.nixosModules.default
]; ];
}; };

Binary file not shown.