diff --git a/flake.lock b/flake.lock index 072f102..54802be 100644 --- a/flake.lock +++ b/flake.lock @@ -1,8 +1,93 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1606424373, + "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1617631617, + "narHash": "sha256-PARRCz55qN3gy07VJZIlFeOX420d0nGF0RzGI/9hVlw=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b2c27d1a81b0dc266270fa8aeecebbd1807fc610", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1614513358, + "narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5466c5bbece17adaab2d82fae80b46e807611bf3", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "flake": false, + "locked": { + "lastModified": 1611672876, + "narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=", + "owner": "hercules-ci", + "repo": "gitignore", + "rev": "211907489e9f198594c0eb0ca9256a1949c9d412", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore", + "type": "github" + } + }, + "himalaya": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1617828522, + "narHash": "sha256-8P2fHNoslQgC5NJFgoEAFj9sgud8okbzFkqOD0yBdTs=", + "owner": "srid", + "repo": "himalaya", + "rev": "d706dd333397c672331f9077e07df09f5b924ba9", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "nixify", + "repo": "himalaya", + "type": "github" + } + }, "home-manager": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1617625716, @@ -20,11 +105,42 @@ }, "nixpkgs": { "locked": { - "lastModified": 1617737732, - "narHash": "sha256-ZwXL2oC/x2YSYkDdnbyFiSD8v1D6uoJSUA3FX0o8BZ4=", + "lastModified": 1617636226, + "narHash": "sha256-iZhBWrOR2DoDs1C+0FlnM9AQLMol/qoGQ+d+S43CKJM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1617325113, + "narHash": "sha256-GksR0nvGxfZ79T91UUtWjjccxazv6Yh/MvEJ82v1Xmw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "54c1e44240d8a527a8f4892608c4bce5440c3ecb", + "type": "github" + }, + "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "f7ff87470148462b06ff5516ae9c4439f9519935", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1617636226, + "narHash": "sha256-iZhBWrOR2DoDs1C+0FlnM9AQLMol/qoGQ+d+S43CKJM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde", "type": "github" }, "original": { @@ -32,7 +148,7 @@ "type": "indirect" } }, - "nixpkgs_2": { + "nixpkgs_4": { "locked": { "lastModified": 1617636226, "narHash": "sha256-iZhBWrOR2DoDs1C+0FlnM9AQLMol/qoGQ+d+S43CKJM=", @@ -50,8 +166,28 @@ }, "root": { "inputs": { + "himalaya": "himalaya", "home-manager": "home-manager", + "nixpkgs": "nixpkgs_4" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1617762447, + "narHash": "sha256-bv1e5VRZnSswnVtBH2Nc1omInZSRgASsS8xO+Fg9whc=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "08263e3fa955acbcb6612c00d920d45e517b242d", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index cb05f08..3f458dd 100644 --- a/flake.nix +++ b/flake.nix @@ -1,16 +1,18 @@ { - description = "NixOS configuration"; + description = "Srid's NixOS configuration"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; + himalaya.url = "github:srid/himalaya/nixify"; }; - outputs = { self, home-manager, nixpkgs }: + outputs = inputs@{ self, home-manager, nixpkgs, ... }: let + system = "x86_64-linux"; # Make configuration for any computer I use in my home office. mkHomeMachine = configurationNix: nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; + inherit system; modules = [ # System configuration configurationNix @@ -19,6 +21,23 @@ ./modules/protonmail-bridge.nix ./modules/monitor-brightness.nix + # Packages from flake inputs + ({ pkgs, lib, ... }: { + environment.systemPackages = + let + # Wrap himalaya to be aware of ProtonMail's bridge cert. + himalaya = lib.getAttrFromPath [system] inputs.himalaya.defaultPackage; + himalayaWithSslEnv = + pkgs.writeScriptBin "h" '' + #!${pkgs.stdenv.shell} + export SSL_CERT_FILE=~/.config/protonmail/bridge/cert.pem + exec ${himalaya}/bin/himalaya + ''; + in [ + himalayaWithSslEnv + ]; + }) + # home-manager configuration home-manager.nixosModules.home-manager {