diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3fb63ec --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1716361217, + "narHash": "sha256-mzZDr00WUiUXVm1ujBVv6A0qRd8okaITyUp4ezYRgc4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46397778ef1f73414b03ed553a3368f0e7e33c2f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5c0c2d6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + nixosConfigurations = { + tohru = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/tohru/configuration.nix + ]; + }; + yevaud = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/yevaud/configuration.nix + ]; + }; + }; + }; +} diff --git a/hive.nix b/hive.nix deleted file mode 100644 index 4e4ffb9..0000000 --- a/hive.nix +++ /dev/null @@ -1,25 +0,0 @@ -let sources = import ./npins; -in { - meta = { - nixpkgs = sources.nixpkgs; - }; - - defaults = { pkgs, ... }: { - imports = [ ./pinning.nix ]; - deployment.replaceUnknownProfiles = false; - }; - - tohru = { name, nodes, ... }: { - deployment = { - allowLocalDeployment = true; - targetHost = null; - }; - - imports = [ ./hosts/tohru/configuration.nix ]; - }; - - yevaud = { - deployment.targetHost = "yevaud.birdsong.network"; - imports = [ ./hosts/yevaud/configuration.nix ]; - }; -} diff --git a/hosts/tohru/configuration.nix b/hosts/tohru/configuration.nix index 2a09eb4..22b1561 100644 --- a/hosts/tohru/configuration.nix +++ b/hosts/tohru/configuration.nix @@ -38,20 +38,19 @@ isNormalUser = true; extraGroups = [ "wheel" "networkmanager" ]; packages = with pkgs; [ - bitwarden - firefox tor-browser-bundle-bin + firefox + tree ]; }; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - colmena + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + bitwarden git - npins plocate - tree wget ]; diff --git a/npins/default.nix b/npins/default.nix deleted file mode 100644 index 4a7c372..0000000 --- a/npins/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by npins. Do not modify; will be overwritten regularly -let - data = builtins.fromJSON (builtins.readFile ./sources.json); - version = data.version; - - mkSource = spec: - assert spec ? type; let - path = - if spec.type == "Git" then mkGitSource spec - else if spec.type == "GitRelease" then mkGitSource spec - else if spec.type == "PyPi" then mkPyPiSource spec - else if spec.type == "Channel" then mkChannelSource spec - else builtins.throw "Unknown source type ${spec.type}"; - in - spec // { outPath = path; }; - - mkGitSource = { repository, revision, url ? null, hash, ... }: - assert repository ? type; - # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository - # In the latter case, there we will always be an url to the tarball - if url != null then - (builtins.fetchTarball { - inherit url; - sha256 = hash; # FIXME: check nix version & use SRI hashes - }) - else assert repository.type == "Git"; builtins.fetchGit { - url = repository.url; - rev = revision; - # hash = hash; - }; - - mkPyPiSource = { url, hash, ... }: - builtins.fetchurl { - inherit url; - sha256 = hash; - }; - - mkChannelSource = { url, hash, ... }: - builtins.fetchTarball { - inherit url; - sha256 = hash; - }; -in -if version == 3 then - builtins.mapAttrs (_: mkSource) data.pins -else - throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/npins/sources.json b/npins/sources.json deleted file mode 100644 index e3ca425..0000000 --- a/npins/sources.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "pins": { - "home-manager": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "nix-community", - "repo": "home-manager" - }, - "branch": "release-23.11", - "revision": "2c78a57c544dd19b07442350727ced097e1aa6e6", - "url": "https://github.com/nix-community/home-manager/archive/2c78a57c544dd19b07442350727ced097e1aa6e6.tar.gz", - "hash": "1zb4qsyn7l1zdiv1kjx07jvgnakpsifc62fxcim50w3ni27cwxk3" - }, - "nixpkgs": { - "type": "Channel", - "name": "nixos-23.11", - "url": "https://releases.nixos.org/nixos/23.11/nixos-23.11.7313.9d29cd266ceb/nixexprs.tar.xz", - "hash": "0phfgypnshhlh6ri54yp2f9qabq0hlq06jn46zv692jy6axss4kx" - } - }, - "version": 3 -} \ No newline at end of file diff --git a/pinning.nix b/pinning.nix deleted file mode 100644 index dd508f5..0000000 --- a/pinning.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, pkgs, ... }: -let sources = import ./npins; -in { - # https://jade.fyi/blog/pinning-nixos-with-npins/ - - # We need the flakes experimental feature to do the NIX_PATH thing cleanly - # below. Given that this is literally the default config for flake-based - # NixOS installations in the upcoming NixOS 24.05, future Nix/Lix releases - # will not get away with breaking it. - nix.settings.experimental-features = "nix-command flakes"; - - # FIXME(24.05 or nixos-unstable): change following two rules to - # - # nixpkgs.flake.source = sources.nixpkgs; - # - # which does the exact same thing, using the same machinery as flake configs - # do as of 24.05. - nix.registry.nixpkgs.to = { - type = "path"; - path = sources.nixpkgs; - }; - nix.nixPath = ["nixpkgs=flake:nixpkgs"]; -}