Fix rpi3 config

This commit is contained in:
Paul-Henri Froidmont 2023-03-28 16:34:46 +02:00
parent 9083c2f5cc
commit e2457ef4ba
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
4 changed files with 50 additions and 54 deletions

45
flake.lock generated
View file

@ -228,19 +228,22 @@
}, },
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "nixpkgs": [
"nixpkgs"
],
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1679786039, "lastModified": 1679738842,
"narHash": "sha256-VNjswu0Q4bZOkWNuc0+dHvRdjUCj+MnDlRfw/Q0R3vI=", "narHash": "sha256-CvqRbsyDW756EskojZptDU590rez29RcHDV3ezoze08=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "cf662b6c98a0da81e06066fff0ecf9cbd4627727", "rev": "83110c259889230b324bb2d35bef78bf5f214a1f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-22.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -260,7 +263,7 @@
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"format-all": "format-all", "format-all": "format-all",
"nix-straight": "nix-straight", "nix-straight": "nix-straight",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs",
"nose": "nose", "nose": "nose",
"ob-racket": "ob-racket", "ob-racket": "ob-racket",
"org": "org", "org": "org",
@ -305,18 +308,17 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1677932085, "lastModified": 1679553901,
"narHash": "sha256-+AB4dYllWig8iO6vAiGGYl0NEgmMgGHpy9gzWJ3322g=", "narHash": "sha256-OhmJc18XNIj0wVC4ZoPnCVoY3SGfcPxaeKJOz1WHo5M=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3c5319ad3aa51551182ac82ea17ab1c6b0f0df89", "rev": "09ad6a72359f6aff0f96ce8e4d1ec2d1271ad15d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "id": "nixpkgs",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "type": "indirect"
"type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
@ -336,21 +338,6 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1679553901,
"narHash": "sha256-OhmJc18XNIj0wVC4ZoPnCVoY3SGfcPxaeKJOz1WHo5M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "09ad6a72359f6aff0f96ce8e4d1ec2d1271ad15d",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1679748960, "lastModified": 1679748960,
"narHash": "sha256-BP8XcYHyj1NxQi04RpyNW8e7KiXSoI+Fy1tXIK2GfdA=", "narHash": "sha256-BP8XcYHyj1NxQi04RpyNW8e7KiXSoI+Fy1tXIK2GfdA=",
@ -484,7 +471,7 @@
"gruvbox-kvantum-theme": "gruvbox-kvantum-theme", "gruvbox-kvantum-theme": "gruvbox-kvantum-theme",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-doom-emacs": "nix-doom-emacs", "nix-doom-emacs": "nix-doom-emacs",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"
} }
}, },

View file

@ -2,7 +2,10 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager"; home-manager = {
url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-doom-emacs.url = "github:nix-community/nix-doom-emacs"; nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
gruvbox-gtk-theme = { gruvbox-gtk-theme = {
url = "github:Fausto-Korpsvart/Gruvbox-GTK-Theme"; url = "github:Fausto-Korpsvart/Gruvbox-GTK-Theme";
@ -16,7 +19,7 @@
outputs = inputs@{ self, home-manager, nixpkgs, nixpkgs-unstable, ... }: outputs = inputs@{ self, home-manager, nixpkgs, nixpkgs-unstable, ... }:
let let
inherit (lib.my) mapModules mapModulesRec mapHosts; inherit (lib.my) mapModules mapModulesRec mkHost;
system = "x86_64-linux"; system = "x86_64-linux";
@ -48,7 +51,14 @@
overlays = { my = (import ./overlay.nix); }; overlays = { my = (import ./overlay.nix); };
nixosConfigurations = mapHosts ./hosts { }; nixosConfigurations = {
nixos-desktop = mkHost ./hosts/nixos-desktop/default.nix { };
froidmpa-laptop = mkHost ./hosts/froidmpa-laptop/default.nix { };
rpi3 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/rpi3/default.nix ];
};
};
}; };
} }

View file

@ -1,17 +1,23 @@
{ pkgs, config, lib, ... }: { inputs, pkgs, ... }: {
{
nix = {
registry.nixpkgs.flake = inputs.nixpkgs;
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true; boot.loader.generic-extlinux-compatible.enable = true;
boot.kernelParams = [ "cma=256M" ]; boot.kernelParams = [ "cma=256M" ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-label/NIXOS_SD";
device = "/dev/disk/by-label/NIXOS_SD"; fsType = "ext4";
fsType = "ext4"; };
};
swapDevices = [{ device = "/swapfile"; size = 1024; }]; swapDevices = [{
device = "/swapfile";
size = 1024;
}];
services.openssh.enable = true; services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keyFiles = [ users.users.root.openssh.authorizedKeys.keyFiles = [
@ -37,11 +43,8 @@
statistics_interval = 90; statistics_interval = 90;
querylog_enabled = true; querylog_enabled = true;
querylog_interval = "2160h"; querylog_interval = "2160h";
upstream_dns = [ upstream_dns =
"tls://doh.mullvad.net" [ "tls://doh.mullvad.net" "[/lan/]192.168.1.1" "[//]192.168.1.1" ];
"[/lan/]192.168.1.1"
"[//]192.168.1.1"
];
local_ptr_upstreams = [ "192.168.1.1" ]; local_ptr_upstreams = [ "192.168.1.1" ];
use_private_ptr_resolvers = true; use_private_ptr_resolvers = true;
resolve_clients = true; resolve_clients = true;
@ -63,9 +66,7 @@
networking.firewall.allowedTCPPorts = [ 53 ]; networking.firewall.allowedTCPPorts = [ 53 ];
networking.firewall.allowedUDPPorts = [ 53 ]; networking.firewall.allowedUDPPorts = [ 53 ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ vim htop ];
htop
];
system.stateVersion = "22.05"; system.stateVersion = "22.05";
} }

View file

@ -1,11 +1,8 @@
{ config, options, lib, home-manager, ... }: { config, options, lib, home-manager, ... }:
with lib; with lib;
with lib.my; with lib.my; {
{ options = with types; { user = mkOpt attrs { }; };
options = with types; {
user = mkOpt attrs { };
};
config = { config = {
@ -23,6 +20,7 @@ with lib.my;
users.${config.user.name} = { users.${config.user.name} = {
home = { home = {
enableNixpkgsReleaseCheck = true;
stateVersion = config.system.stateVersion; stateVersion = config.system.stateVersion;
}; };
}; };