Commit f7f2cc64 authored by fpletz's avatar fpletz 🚧
Browse files

add loungepi, adjust api git repo

parent ceeba0a7
colmena build:
image: nixos/nix:latest
loungepi apply:
tags:
- docker
- colmena-apply-local
- loungepi
script:
- echo 'experimental-features = nix-command flakes' >> /etc/nix/nix.conf
- nix-env -iA nixpkgs.git
- nix run . -- build -v
- colmena apply-local -v switch
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_BRANCH
- if: $CI_DEFAULT_BRANCH
#colmena build:
# image: nixos/nix:latest
# tags:
# - docker
# script:
# - echo 'experimental-features = nix-command flakes' >> /etc/nix/nix.conf
# - nix-env -iA nixpkgs.git
# - nix run . -- build -v
# rules:
# - if: $CI_MERGE_REQUEST_IID
# - if: $CI_COMMIT_BRANCH
......@@ -15,6 +15,26 @@
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs_master"
]
},
"locked": {
"lastModified": 1644534280,
"narHash": "sha256-Gzf/Jq/F1vvTp6XkzPU+pBCj3OSAFLiR7f0ptwRseiI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6d9d9294d09b5e88df65f8c6651efb8a4d7d2476",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"muccc-api": {
"inputs": {
"flake-utils": "flake-utils",
......@@ -23,26 +43,26 @@
]
},
"locked": {
"lastModified": 1642276612,
"narHash": "sha256-TLhIlWptDWnX6Vok0tCS3d3YOWugbPSWzKJiqQgeVps=",
"lastModified": 1642616633,
"narHash": "sha256-zsg0c1ReWOM1ACfH2M9mmBRqZFCvI0TuQULXB5Vaj4I=",
"ref": "master",
"rev": "a135d5a89d2e2baf83937bed709120775a2eacb1",
"revCount": 16,
"rev": "fab2d57eb11dba393d1b361bfa40a3614edf738e",
"revCount": 19,
"type": "git",
"url": "https://gitlab.muc.ccc.de/fpletz/muccc-api"
"url": "https://gitlab.muc.ccc.de/muCCC/api"
},
"original": {
"type": "git",
"url": "https://gitlab.muc.ccc.de/fpletz/muccc-api"
"url": "https://gitlab.muc.ccc.de/muCCC/api"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1641870998,
"narHash": "sha256-6HkxR2WZsm37VoQS7jgp6Omd71iw6t1kP8bDbaqCDuI=",
"lastModified": 1644472683,
"narHash": "sha256-sP6iM4NksOYO6NFfTJ96cg+ClPnq6cdY30xKA1iYtyU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "386234e2a61e1e8acf94dfa3a3d3ca19a6776efb",
"rev": "7adc9c14ec74b27358a8df9b973087e351425a79",
"type": "github"
},
"original": {
......@@ -52,20 +72,38 @@
"type": "github"
}
},
"nixpkgs_master": {
"locked": {
"lastModified": 1644626624,
"narHash": "sha256-WSfoxlSY0S/eRp/IzeGH+QC3UpwOcJMmLrFl+Vl2xHk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8f89db32523ac1a7105a8d439ff1cb8173a4c314",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"muccc-api": "muccc-api",
"nixpkgs": "nixpkgs",
"nixpkgs_master": "nixpkgs_master",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
......
......@@ -3,12 +3,15 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
nixpkgs_master.url = "github:NixOS/nixpkgs/master";
utils.url = "github:numtide/flake-utils";
muccc-api.url = "git+https://gitlab.muc.ccc.de/fpletz/muccc-api";
muccc-api.url = "git+https://gitlab.muc.ccc.de/muCCC/api";
muccc-api.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs_master";
};
outputs = { self, nixpkgs, utils, muccc-api, ... }: let
outputs = { self, nixpkgs, nixpkgs_master, utils, muccc-api, home-manager, ... }: let
supportedSystems = utils.lib.defaultSystems;
in utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs { inherit system; };
......@@ -19,17 +22,23 @@
};
}) // {
colmena = {
meta.nixpkgs = import nixpkgs { };
meta = {
nixpkgs = import nixpkgs { };
nodeNixpkgs = {
loungepi = import nixpkgs_master { };
};
};
defaults = { name, pkgs, lib, ... }: {
deployment.targetHost = lib.mkDefault "${name}.muc.ccc.de";
networking.hostName = lib.mkDefault name;
time.timeZone = "UTC";
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelPackages = lib.mkOptionDefault pkgs.linuxPackages_latest;
boot.tmpOnTmpfs = true;
documentation.nixos.enable = false;
environment.systemPackages = with pkgs; [
wget curl htop iftop tmux tcpdump rsync
wget curl htop iftop tmux tcpdump rsync git
alacritty.terminfo
];
programs.bash.enableCompletion = true;
......@@ -59,7 +68,7 @@
};
zramSwap.enable = true;
nixpkgs.system = "x86_64-linux";
nixpkgs.system = lib.mkDefault "x86_64-linux";
nixpkgs.overlays = [ muccc-api.overlay ];
# include git rev of this repo/flake into the nixos-version
......@@ -88,6 +97,16 @@
./nixbus.nix
];
};
loungepi = { name, nodes, pkgs, ... }: {
deployment.targetHost = "83.133.179.137";
deployment.allowLocalDeployment = true;
nixpkgs.system = "aarch64-linux";
imports = [
home-manager.nixosModules.home-manager
./loungepi.nix
];
};
};
};
}
{ config, pkgs, lib, ... }:
{
imports = [
"${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/9886a06e4745edb31587d0e9481ad82d35f0d593.tar.gz"}/raspberry-pi/4"
];
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
networking = {
hostName = "loungepi";
useNetworkd = true;
useDHCP = false;
interfaces.eth0.useDHCP = true;
interfaces.wlan0.useDHCP = true;
wireless = {
enable = true;
networks."muccc.legacy-5GHz".psk = "haileris";
interfaces = [ "wlan0" ];
};
};
systemd.network.networks."40-eth0" = {
linkConfig.RequiredForOnline = false;
dhcpV4Config.RouteMetric = 23;
dhcpV6Config.RouteMetric = 23;
extraConfig = ''
[IPv6AcceptRA]
RouteMetric=23
'';
};
boot.tmpOnTmpfs = true;
boot.extraModprobeConfig = ''
options snd_bcm2835 enable_headphones=1
'';
zramSwap = {
enable = true;
memoryPercent = 100;
};
environment.systemPackages = with pkgs; [ colmena ];
programs.vim.defaultEditor = true;
environment.sessionVariables.PAN_MESA_DEBUG = "gl3";
users = {
mutableUsers = false;
users.lounge = {
isNormalUser = true;
password = "alarm";
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFJY+/tAXZFm9U+nJt0kKo6e/TrYiH7E49n0ktbuF5I6 fpletz@fpine"
];
};
users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFJY+/tAXZFm9U+nJt0kKo6e/TrYiH7E49n0ktbuF5I6 fpletz@fpine"
];
};
home-manager.users.lounge = { pkgs, ... }: {
#programs.bash.enable = true;
programs.tmux.enable = true;
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
config = {
modifier = "Mod4";
bars = [];
startup = [
{ command = "${pkgs.foot}/bin/foot -F tmux new-session -s screen"; }
];
};
};
programs.waybar = {
enable = true;
systemd.enable = true;
#style = ''
# * {
# font-family: Fira Code;
# font-size: 20px;
# }
#'';
};
home.packages = with pkgs; [ mpv youtubeDL pulsemixer ];
};
# Enable GPU acceleration
hardware.raspberry-pi."4".fkms-3d.enable = true;
hardware.raspberry-pi."4".audio.enable = true;
hardware.raspberry-pi."4".dwc2.enable = true;
sound.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
security.rtkit.enable = true;
programs.sway.enable = true;
fonts.fonts = with pkgs; [ fira fira-code fira-code-symbols fira-mono powerline-fonts font-awesome_4 font-awesome_5 ];
services.greetd = {
enable = true;
settings = {
initial_session = {
command = "sway";
user = "lounge";
};
default_session = {
command = "${lib.makeBinPath [pkgs.greetd.tuigreet]}/tuigreet --time --cmd sway";
user = "greeter";
};
};
};
systemd.services.gitlab-runner.serviceConfig.DynamicUser = lib.mkForce false;
services.gitlab-runner = {
enable = true;
concurrent = 1;
services = {
loungepi = {
protected = true;
registrationConfigFile = pkgs.writeText "gitlab-registration" ''
CI_SERVER_URL=https://gitlab.muc.ccc.de
REGISTRATION_TOKEN=8aR7kTXfbyKXcaAWk5Pa
'';
executor = "shell";
tagList = [ "colmena-apply-local" "loungepi" ];
};
};
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment