Moved to flake for docker functionality

This commit is contained in:
Sebastian 2024-02-12 18:07:52 +01:00
parent fa7de8fa5b
commit 8ff538388d
3 changed files with 81 additions and 26 deletions

View File

@ -43,6 +43,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -96,10 +114,46 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": {
"locked": {
"lastModified": 1701282334,
"narHash": "sha256-MxCVrXY6v4QmfTwIysjjaX0XUhqBbxTWWB4HXtDYsdk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "057f9aecfb71c4437d2b27d3323df7f93c010b7e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2",
"satnogs-client-docker": "satnogs-client-docker"
}
},
"satnogs-client-docker": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1707670776,
"narHash": "sha256-RoLGHz5c5M8H7iWSPuOFGaZh7jEpZ8HLebAOYN1OJAk=",
"ref": "refs/heads/main",
"rev": "c3fb88e4ced15cf2b2a27b2e2ed858eac2a2e845",
"revCount": 4,
"type": "git",
"url": "ssh://git@git.zenerdio.de/sebastian/satnogs-client-docker-flake.git"
},
"original": {
"type": "git",
"url": "ssh://git@git.zenerdio.de/sebastian/satnogs-client-docker-flake.git"
} }
}, },
"systems": { "systems": {
@ -116,6 +170,21 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -5,9 +5,10 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/23.11"; nixpkgs.url = "github:NixOS/nixpkgs/23.11";
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
satnogs-client-docker.url = "git+ssh://git@git.zenerdio.de/sebastian/satnogs-client-docker-flake.git";
}; };
outputs = { self, nixpkgs, agenix, ... }: outputs = { self, nixpkgs, agenix, satnogs-client-docker, ... }:
let let
pkgs = nixpkgs.legacyPackages.x86_64-linux; pkgs = nixpkgs.legacyPackages.x86_64-linux;
in in
@ -50,6 +51,7 @@
imports = [ imports = [
./modules/common-packages.nix ./modules/common-packages.nix
./machines/dl1ssk/configuration.nix ./machines/dl1ssk/configuration.nix
satnogs-client-docker.nixosModules.default
]; ];
}; };
}; };

View File

@ -4,16 +4,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
let
satnogs-env = {
SATNOGS_ANTENNA = "RX";
SATNOGS_RF_GAIN = "5";
SATNOGS_RX_SAMP_RATE = "2.048e6";
SATNOGS_SOAPY_RX_DEVICE = "driver=rtlsdr";
SATNOGS_STATION_ELEV = "225";
SATNOGS_STATION_ID = "517";
};
in
{ {
imports = imports =
[ [
@ -73,20 +63,14 @@ in
# ]; # ];
# }; # };
virtualisation.docker.enable = true; services.satnogs-client-docker = {
enable = true;
systemd.services.satnogs-docker-compose = { satnogs-antenna = "RX";
script = concatStringsSep " \\\n " ([ satnogs-rf-gain = "5";
"${pkgs.docker-compose}/bin/docker-compose" satnogs-rx-samp-rate = "2.048e6";
"-f ${./satnogs-docker-compose.yml}" satnogs-soapy-rx-device = "driver=rtlsdr";
] satnogs-station-elev = "225";
++ (mapAttrsToList (k: v: "-e ${escapeShellArg k}=${escapeShellArg v}") satnogs-env) satnogs-station-id = "517";
++ [ "up" ]);
preStop = "${pkgs.docker-compose}/bin/docker-compose -f ${./satnogs-docker-compose.yml} down";
wantedBy = [ "multi-user.target" ];
after = [ "docker.service" "docker.socket" ];
}; };
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run: