Compare commits

..

No commits in common. "569a4ed564af393c11713d4a27dac2aa8ba61340" and "8f87951156818b98ad4a57b369defb624bfc1fc1" have entirely different histories.

4 changed files with 24 additions and 66 deletions

View file

@ -5,7 +5,7 @@ let
in in
stdenv.mkDerivation { stdenv.mkDerivation {
inherit name version; inherit name version;
src = ../src; src = ./src;
installPhase = '' installPhase = ''
cp -r . $out cp -r . $out
''; '';

18
flake.lock generated
View file

@ -18,7 +18,23 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
} }
} }
}, },

View file

@ -1,34 +1,21 @@
{ {
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.systems.url = "github:nix-systems/default-linux";
outputs = outputs =
inputs: inputs:
let let
systems = [ inherit (inputs.nixpkgs) lib legacyPackages;
"x86_64-linux" forEachSystem = lib.genAttrs (import inputs.systems);
"aarch64-linux"
];
inherit (builtins) map listToAttrs;
forAllSystems =
f:
listToAttrs (
map (system: {
name = system;
value = f system;
}) systems
);
in in
{ {
packages = forAllSystems ( packages = forEachSystem (
system: system:
let let
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = legacyPackages.${system};
in in
{ {
default = pkgs.callPackage ./nix/package.nix { }; default = pkgs.callPackage ./default.nix { };
} }
); );
nixosModules = forAllSystems (_: {
default = import ./nix/modules/nixos.nix;
});
}; };
} }

View file

@ -1,45 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (builtins) toString;
inherit (lib) mkOption mkEnableOption mkIf;
inherit (lib.types) port str;
cfg = config.services.rrv-sh;
package = pkgs.callPackage ../package.nix { };
in
{
options.services.rrv-sh = {
enable = mkEnableOption "";
port = mkOption {
type = port;
default = 2309;
};
user = mkOption {
type = str;
default = "rrv-sh";
};
group = mkOption {
type = str;
default = "rrv-sh";
};
};
config = mkIf cfg.enable {
systemd.services.rrv-sh = {
description = "the rrv.sh website";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
Restart = "on-failure";
RestartSec = "5s";
User = cfg.user;
Group = cfg.group;
ExecStart = "${pkgs.live-server}/bin/live-server -p ${toString cfg.port} ${package}";
};
};
};
}