diff --git a/cage.nix b/cage.nix new file mode 100644 index 0000000..602d637 --- /dev/null +++ b/cage.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + services.cage = { + enable = true; + user = "cage"; + program = "${pkgs.stremio}/bin/stremio"; + }; +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8e0e604 --- /dev/null +++ b/flake.lock @@ -0,0 +1,63 @@ +{ + "nodes": { + "nixlib": { + "locked": { + "lastModified": 1726362065, + "narHash": "sha256-4h15WKdrs9zf6DGaeeV7ntU/pHHGkH6geYt1QBW0CP4=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "9db4db09d82e4b2207bfa7f1e747a4f49d214555", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726707592, + "narHash": "sha256-FCbXzY5cN9pMUF9xxvRAPBWj+pnmcouwuQb+OrMWo0M=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "0ac657a7486103867cb4d7dcb660cc73c8c37651", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1726447378, + "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixos-generators": "nixos-generators", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cbc5047 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-24.05"; + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = { self, nixpkgs, nixos-generators, ... }: { + packages.x86_64-linux = { + default = nixos-generators.nixosGenerate { + system = "x86_64-linux"; + modules = [ + ./system + ./user.nix + ./cage.nix + ]; + format = "raw-efi"; + }; + raw-efi = nixos-generators.nixosGenerate { + system = "x86_64-linux"; + modules = [ + ./system + ./user.nix + ./cage.nix + ]; + format = "raw-efi"; + }; + }; + }; +} diff --git a/system/audio.nix b/system/audio.nix new file mode 100644 index 0000000..ca6ecef --- /dev/null +++ b/system/audio.nix @@ -0,0 +1,6 @@ +{ + services.pipewire = { + enable = true; + audio.enable = true; + }; +} diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..db6b795 --- /dev/null +++ b/system/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./getty.nix + ./audio.nix + ./networking.nix + ./other.nix +]; +} diff --git a/system/getty.nix b/system/getty.nix new file mode 100644 index 0000000..c1e0076 --- /dev/null +++ b/system/getty.nix @@ -0,0 +1,5 @@ +{ + services.getty = { + autologinUser = "cage"; + }; +} diff --git a/system/networking.nix b/system/networking.nix new file mode 100644 index 0000000..de208e2 --- /dev/null +++ b/system/networking.nix @@ -0,0 +1,5 @@ +{ + networking = { + hostName = "StremioCageTV"; + }; +} diff --git a/system/other.nix b/system/other.nix new file mode 100644 index 0000000..87f88e9 --- /dev/null +++ b/system/other.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +{ + environment = { + # Systemwide installed packages + systemPackages = with pkgs; [ + stremio + ]; + }; + + boot = { + kernelParams = [ "console=tty0" ]; + loader = { + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; + }; + }; + }; +} diff --git a/user.nix b/user.nix new file mode 100644 index 0000000..80676ee --- /dev/null +++ b/user.nix @@ -0,0 +1,9 @@ +{ + users.users.cage = { + initialPassword = ""; + isNormalUser = true; + description = "Cage User"; + extraGroups = [ "networkmanager" "wheel" "sudo" "adm" "video" "audio" ]; + }; +} +