Skip to content

Commit

Permalink
Merge pull request #128 from knuton/nixpgs-2305
Browse files Browse the repository at this point in the history
Migrate to Nixpkgs 23.05
  • Loading branch information
guyonvarch authored Sep 8, 2023
2 parents ca21cc7 + 54cab57 commit 318c024
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 29 deletions.
23 changes: 10 additions & 13 deletions application.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,6 @@ rec {
;;
esac
# We want to avoid making the user configure audio outputs, but
# instead route audio to both the standard output and any connected
# displays. This looks for any "HDMI" device on ALSA card 0 and
# tries to add a sink for it. Both HDMI and DisplayPort connectors
# will count as "HDMI". We ignore failure from disconnected ports.
for dev_num in $(aplay -l | grep "^card 0:" | grep "HDMI" | grep "device [0-9]\+" | sed "s/.*device \([0-9]\+\):.*/\1/"); do
printf "Creating ALSA sink for device $dev_num: "
pactl load-module module-alsa-sink device="hw:0,$dev_num" sink_name="hdmi$dev_num" sink_properties="device.description='HDMI-$dev_num'" || true
done
pactl load-module module-combine-sink sink_name=combined
pactl set-default-sink combined
# Enable Qt WebEngine Developer Tools (https://doc.qt.io/qt-5/qtwebengine-debugging.html)
export QTWEBENGINE_REMOTE_DEBUGGING="127.0.0.1:3355"
Expand Down Expand Up @@ -140,7 +128,16 @@ rec {

# Audio
sound.enable = true;
hardware.pulseaudio = { enable = true; };
hardware.pulseaudio = {
enable = true;
extraConfig = ''
# Use HDMI output
set-card-profile 0 output:hdmi-stereo
# Respond to changes in connected outputs
load-module module-switch-on-port-available
load-module module-switch-on-connect
'';
};

# Enable avahi for Senso discovery
services.avahi.enable = true;
Expand Down
3 changes: 1 addition & 2 deletions base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ with lib;
};

config = {

# Use overlayed pkgs.
nixpkgs.pkgs = pkgs;
nixpkgs.pkgs = lib.mkDefault pkgs;

# Custom label when identifying OS
system.nixos.label = "${safeProductName}-${version}";
Expand Down
5 changes: 3 additions & 2 deletions base/remote-maintenance.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ in
services.openssh = {
enable = true;

# but not with password
passwordAuthentication = false;
# Restrict authentication to authorized keys
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};

# only with these special keys:
Expand Down
1 change: 1 addition & 0 deletions controller/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- os: Split system definition into base and application layers
- os: Make build outputs and displayed system name configurable through application layer
- os: Include live system ISO in deployed outputs
- os: Update nixpkgs channel to 23.05
- status screen: Display persistent storage usage statistics

# [2023.2.0] - 2023-03-06
Expand Down
6 changes: 5 additions & 1 deletion controller/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ ocamlPackages.buildDunePackage rec {

useDune2 = true;

buildInputs = with ocamlPackages; [
nativeBuildInputs = [
discount # Transform Markdown to HTML
ocamlPackages.obus
];

buildInputs = with ocamlPackages; [
nodejs
utop
];
Expand Down
3 changes: 0 additions & 3 deletions installer/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
with lib;

{
# Force use of already overlayed nixpkgs in modules
nixpkgs.pkgs = pkgs;

imports = [
(pkgs.importFromNixos "modules/installer/cd-dvd/iso-image.nix")
];
Expand Down
3 changes: 0 additions & 3 deletions live/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ let nixos = pkgs.importFromNixos ""; in
];

config = {
# Force use of already overlayed nixpkgs in modules
nixpkgs.pkgs = pkgs;

# ISO image customization
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
Expand Down
8 changes: 5 additions & 3 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
let

nixpkgs = builtins.fetchTarball {
# nixos-22.11 2023-01-11
url = "https://github.com/nixos/nixpkgs/archive/54644f409ab471e87014bb305eac8c50190bcf48.tar.gz";
sha256 = "1pqgwbprmm84nsylp8jjhrwchzn3cv9iiaz1r89mazfil9qcadz0";
# nixos-23.05 2023-08-14
url = "https://github.com/nixos/nixpkgs/archive/720e61ed8de116eec48d6baea1d54469b536b985.tar.gz";
sha256 = "0ii10wmm8hqdp7bii7iza58rjaqs4z3ivv71qyix3qawwxx48hw9";
};

overlay =
Expand All @@ -18,6 +18,8 @@ let
ocamlPackages = super.ocamlPackages.overrideScope' (self: super: {
semver = self.callPackage ./ocaml-modules/semver {};
obus = self.callPackage ./ocaml-modules/obus {};
opium = self.callPackage ./ocaml-modules/opium {};
opium_kernel = self.callPackage ./ocaml-modules/opium_kernel {};
});

};
Expand Down
3 changes: 1 addition & 2 deletions pkgs/ocaml-modules/obus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ buildDunePackage rec {

useDune2 = true;

buildInputs = [ ];
nativeBuildInputs = [ menhir ];
propagatedBuildInputs = [
lwt_log
lwt_ppx
lwt_react
menhir
ocaml_lwt
ppxlib
react
Expand Down
32 changes: 32 additions & 0 deletions pkgs/ocaml-modules/opium/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ buildDunePackage

, ppx_sexp_conv
, ppx_fields_conv

, cmdliner
, cohttp-lwt-unix
, logs
, magic-mime
, opium_kernel
, stringext

, alcotest
}:

buildDunePackage {
pname = "opium";
inherit (opium_kernel) version src meta minimumOCamlVersion;

useDune2 = true;

doCheck = true;

buildInputs = [
ppx_sexp_conv ppx_fields_conv
alcotest
];

propagatedBuildInputs = [
opium_kernel cmdliner cohttp-lwt-unix magic-mime logs stringext
];
}
44 changes: 44 additions & 0 deletions pkgs/ocaml-modules/opium_kernel/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{ lib
, buildDunePackage
, fetchurl

, ppx_fields_conv
, ppx_sexp_conv

, cohttp-lwt
, ezjsonm
, hmap
, sexplib
, fieldslib
}:

buildDunePackage rec {
pname = "opium_kernel";
version = "0.18.0";

useDune2 = true;

minimumOCamlVersion = "4.04.1";

src = fetchurl {
url = "https://github.com/rgrinberg/opium/releases/download/${version}/opium-${version}.tbz";
sha256 = "0a2y9gw55psqhqli3a5ps9mfdab8r46fnbj882r2sp366sfcy37q";
};

doCheck = true;

buildInputs = [
ppx_sexp_conv ppx_fields_conv
];

propagatedBuildInputs = [
hmap cohttp-lwt ezjsonm sexplib fieldslib
];

meta = {
description = "Sinatra like web toolkit for OCaml based on cohttp & lwt";
homepage = "https://github.com/rgrinberg/opium";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.pmahoney ];
};
}

0 comments on commit 318c024

Please sign in to comment.